UAT: agents plan cancel JSON/YAML output missing spec-required envelope, sandbox, child_plans, recovery fields — uses cancel_reason instead of reason #2553

Open
opened 2026-04-03 18:53:09 +00:00 by freemo · 3 comments
Owner

Bug Report

What was tested

The agents plan cancel JSON and YAML output format vs the specification.

Expected behavior (from spec)

Per docs/specification.md §agents plan cancel, the JSON output must be:

{
  "command": "plan cancel",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J",
    "phase": "execute",
    "reason": "blocked on credentials",
    "state": "cancelled",
    "cancelled_at": "13:02:15",
    "sandbox": {
      "status": "preserved",
      "files_modified": 3,
      "checkpoints": 2
    },
    "child_plans": {
      "completed": 1,
      "cancelled": 1,
      "artifacts_preserved": true
    },
    "recovery": [
      "Resolve credentials",
      "Run agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J"
    ]
  },
  "timing": { "started": "2026-02-08T13:02:15Z", "duration_ms": 340 },
  "messages": ["Plan cancelled"]
}

Actual behavior (from code)

In src/cleveragents/cli/commands/plan.py (lines 2556–2576), the JSON output is:

if fmt != OutputFormat.RICH.value:
    data = _plan_spec_dict(plan)
    if reason:
        data["cancel_reason"] = reason  # ← wrong field name, should be "reason"
    console.print(format_output(data, fmt))

_plan_spec_dict() returns a flat dict with verbose plan fields — completely different from the spec's required structure.

Field name mismatch:

  • cancel_reason → should be reason

Missing fields:

  • cancelled_at — timestamp when plan was cancelled
  • sandbox.status — "preserved"
  • sandbox.files_modified — number of files modified before cancellation
  • sandbox.checkpoints — number of checkpoints created
  • child_plans.completed — completed child plan count
  • child_plans.cancelled — cancelled child plan count
  • child_plans.artifacts_preserved — whether artifacts are preserved
  • recovery — list of recovery steps

Missing envelope:

  • command, status, exit_code, timing, messages top-level fields

Note

PR #1510 addresses the rich output format for plan cancel. This issue specifically covers the JSON/YAML output format which is a separate concern.

Code location

src/cleveragents/cli/commands/plan.py, function cancel_plan, lines ~2556–2576.


Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-uat-tester

## Bug Report ### What was tested The `agents plan cancel` JSON and YAML output format vs the specification. ### Expected behavior (from spec) Per `docs/specification.md` §`agents plan cancel`, the JSON output must be: ```json { "command": "plan cancel", "status": "ok", "exit_code": 0, "data": { "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J", "phase": "execute", "reason": "blocked on credentials", "state": "cancelled", "cancelled_at": "13:02:15", "sandbox": { "status": "preserved", "files_modified": 3, "checkpoints": 2 }, "child_plans": { "completed": 1, "cancelled": 1, "artifacts_preserved": true }, "recovery": [ "Resolve credentials", "Run agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J" ] }, "timing": { "started": "2026-02-08T13:02:15Z", "duration_ms": 340 }, "messages": ["Plan cancelled"] } ``` ### Actual behavior (from code) In `src/cleveragents/cli/commands/plan.py` (lines 2556–2576), the JSON output is: ```python if fmt != OutputFormat.RICH.value: data = _plan_spec_dict(plan) if reason: data["cancel_reason"] = reason # ← wrong field name, should be "reason" console.print(format_output(data, fmt)) ``` `_plan_spec_dict()` returns a flat dict with verbose plan fields — completely different from the spec's required structure. **Field name mismatch:** - `cancel_reason` → should be `reason` **Missing fields:** - `cancelled_at` — timestamp when plan was cancelled - `sandbox.status` — "preserved" - `sandbox.files_modified` — number of files modified before cancellation - `sandbox.checkpoints` — number of checkpoints created - `child_plans.completed` — completed child plan count - `child_plans.cancelled` — cancelled child plan count - `child_plans.artifacts_preserved` — whether artifacts are preserved - `recovery` — list of recovery steps **Missing envelope:** - `command`, `status`, `exit_code`, `timing`, `messages` top-level fields ### Note PR #1510 addresses the rich output format for `plan cancel`. This issue specifically covers the JSON/YAML output format which is a separate concern. ### Code location `src/cleveragents/cli/commands/plan.py`, function `cancel_plan`, lines ~2556–2576. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.5.0 milestone 2026-04-05 05:06:34 +00:00
Author
Owner

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.
Author
Owner

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#2553
No description provided.