UAT: plan cancel --format json missing spec-required fields: command, cancelled_at, sandbox, child_plans, recovery #4564

Open
opened 2026-04-08 15:19:07 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Plan lifecycle — agents plan cancel command
Severity: High — JSON API contract broken, missing critical cancel confirmation fields
Discovered by: UAT tester (uat-tester-plan-lifecycle)


Summary

agents plan cancel --format json returns an incomplete JSON envelope. The command field is empty string and several spec-required data fields are missing: cancelled_at, sandbox, child_plans, and recovery.


Expected Behavior (from spec, §agents plan cancel)

{
  "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

Running agents plan cancel 01KNKK0MQBWQ5NF0BZYKTF4WJP --reason "test" --format json:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "01KNKK0MQBWQ5NF0BZYKTF4WJP",
    "namespaced_name": "local/security-audit-01knkk0m",
    "phase": "strategize",
    "processing_state": "cancelled",
    "state": "cancelled",
    "error_message": "test",
    "cancel_reason": "test",
    ...
  },
  "timing": { "duration_ms": 0 },
  "messages": [{ "level": "ok", "text": "ok" }]
}

Deviations Found

  1. command field is empty string — should be "plan cancel"
  2. data.cancelled_at missing — spec requires the cancellation timestamp
  3. data.sandbox missing — spec requires {status, files_modified, checkpoints} showing sandbox state after cancel
  4. data.child_plans missing — spec requires {completed, cancelled, artifacts_preserved} for child plan status
  5. data.recovery missing — spec requires a list of recovery steps
  6. data.reason missing — spec uses reason, implementation uses cancel_reason and error_message
  7. messages format wrong — should be ["Plan cancelled"], not [{"level": "ok", "text": "ok"}]

Steps to Reproduce

agents plan cancel <PLAN_ID> --reason "test reason" --format json

Code Location

src/cleveragents/cli/commands/plan.pycancel_plan command (around line 2775)

The command uses _plan_spec_dict() which returns the full internal plan object, not the spec-required cancel confirmation view.


Impact

Automation scripts that check cancel confirmation (e.g., to verify sandbox preservation or get recovery steps) will fail because the expected fields are absent.


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

## Bug Report **Feature Area:** Plan lifecycle — `agents plan cancel` command **Severity:** High — JSON API contract broken, missing critical cancel confirmation fields **Discovered by:** UAT tester (uat-tester-plan-lifecycle) --- ## Summary `agents plan cancel --format json` returns an incomplete JSON envelope. The `command` field is empty string and several spec-required data fields are missing: `cancelled_at`, `sandbox`, `child_plans`, and `recovery`. --- ## Expected Behavior (from spec, §agents plan cancel) ```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 Running `agents plan cancel 01KNKK0MQBWQ5NF0BZYKTF4WJP --reason "test" --format json`: ```json { "command": "", "status": "ok", "exit_code": 0, "data": { "plan_id": "01KNKK0MQBWQ5NF0BZYKTF4WJP", "namespaced_name": "local/security-audit-01knkk0m", "phase": "strategize", "processing_state": "cancelled", "state": "cancelled", "error_message": "test", "cancel_reason": "test", ... }, "timing": { "duration_ms": 0 }, "messages": [{ "level": "ok", "text": "ok" }] } ``` --- ## Deviations Found 1. **`command` field is empty string** — should be `"plan cancel"` 2. **`data.cancelled_at` missing** — spec requires the cancellation timestamp 3. **`data.sandbox` missing** — spec requires `{status, files_modified, checkpoints}` showing sandbox state after cancel 4. **`data.child_plans` missing** — spec requires `{completed, cancelled, artifacts_preserved}` for child plan status 5. **`data.recovery` missing** — spec requires a list of recovery steps 6. **`data.reason` missing** — spec uses `reason`, implementation uses `cancel_reason` and `error_message` 7. **`messages` format wrong** — should be `["Plan cancelled"]`, not `[{"level": "ok", "text": "ok"}]` --- ## Steps to Reproduce ```bash agents plan cancel <PLAN_ID> --reason "test reason" --format json ``` --- ## Code Location `src/cleveragents/cli/commands/plan.py` — `cancel_plan` command (around line 2775) The command uses `_plan_spec_dict()` which returns the full internal plan object, not the spec-required cancel confirmation view. --- ## Impact Automation scripts that check cancel confirmation (e.g., to verify sandbox preservation or get recovery steps) will fail because the expected fields are absent. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 17:41:40 +00:00
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#4564
No description provided.