UAT: agents plan cancel --format json output missing spec envelope and cancel-specific fields #5034

Closed
opened 2026-04-09 00:49:48 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Plan Lifecycle — agents plan cancel

Summary

agents plan cancel <PLAN_ID> --format json returns a raw plan data dict instead of the spec-required JSON envelope. The output is missing the command, status, exit_code, timing, and messages top-level fields, and the data section is missing cancel-specific fields like reason, cancelled_at, sandbox, child_plans, and recovery.

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

In src/cleveragents/cli/commands/plan.py, the cancel_plan command (lines 2774–2822) calls _plan_spec_dict(plan) and optionally adds cancel_reason. This produces:

  1. No top-level envelope: No command, status, exit_code, timing, messages fields
  2. Wrong field name: cancel_reason instead of reason
  3. Missing cancelled_at: No timestamp of when cancellation occurred
  4. Missing sandbox section: No sandbox preservation status, files modified, or checkpoint count
  5. Missing child_plans section: No info on completed/cancelled child plans or artifact preservation
  6. Missing recovery section: No recovery suggestions for the user

Code Location

src/cleveragents/cli/commands/plan.py:

  • cancel_plan function (lines 2774–2822)

Impact

Programmatic consumers of agents plan cancel --format json receive a non-spec-compliant response. The missing recovery section is particularly impactful as it provides actionable next steps for users.


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

## Bug Report **Feature Area:** Plan Lifecycle — `agents plan cancel` ### Summary `agents plan cancel <PLAN_ID> --format json` returns a raw plan data dict instead of the spec-required JSON envelope. The output is missing the `command`, `status`, `exit_code`, `timing`, and `messages` top-level fields, and the `data` section is missing cancel-specific fields like `reason`, `cancelled_at`, `sandbox`, `child_plans`, and `recovery`. ### 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 In `src/cleveragents/cli/commands/plan.py`, the `cancel_plan` command (lines 2774–2822) calls `_plan_spec_dict(plan)` and optionally adds `cancel_reason`. This produces: 1. **No top-level envelope**: No `command`, `status`, `exit_code`, `timing`, `messages` fields 2. **Wrong field name**: `cancel_reason` instead of `reason` 3. **Missing `cancelled_at`**: No timestamp of when cancellation occurred 4. **Missing `sandbox` section**: No sandbox preservation status, files modified, or checkpoint count 5. **Missing `child_plans` section**: No info on completed/cancelled child plans or artifact preservation 6. **Missing `recovery` section**: No recovery suggestions for the user ### Code Location `src/cleveragents/cli/commands/plan.py`: - `cancel_plan` function (lines 2774–2822) ### Impact Programmatic consumers of `agents plan cancel --format json` receive a non-spec-compliant response. The missing `recovery` section is particularly impactful as it provides actionable next steps for users. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Closing as duplicate of #4975 — both issues report the same problem: agents plan cancel --format json output missing spec-required envelope.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Closing as duplicate of #4975 — both issues report the same problem: `agents plan cancel --format json` output missing spec-required envelope. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5034
No description provided.