UAT: agents plan status JSON/YAML output missing spec-required envelope and structured sections — returns flat plan dict instead #2539

Open
opened 2026-04-03 18:50:25 +00:00 by freemo · 0 comments
Owner

Bug Report

What was tested

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

Expected behavior (from spec)

Per docs/specification.md §agents plan status, the JSON output must follow the standard CLI envelope format:

{
  "command": "plan status",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J",
    "phase": "execute",
    "state": "processing",
    "action": "local/code-coverage",
    "project": "local/api-service",
    "automation": "review",
    "attempt": 1,
    "progress": [
      { "step": "Strategize", "status": "done" },
      { "step": "Execute", "status": "running" },
      { "step": "Apply", "status": "queued" }
    ],
    "timing": {
      "started": "12:57:01",
      "elapsed": "00:01:12",
      "eta": "00:03:45"
    },
    "execution": {
      "sandbox": "git_worktree",
      "tool_calls": 8,
      "files_modified": 3,
      "child_plans": "1/2 complete",
      "checkpoints": 2
    },
    "cost": {
      "tokens_used": 12420,
      "cost_so_far": 0.041,
      "estimated": 0.085
    }
  },
  "timing": { "started": "2026-02-08T12:57:01Z", "duration_ms": 120 },
  "messages": ["Status refreshed"]
}

For errored plans, the spec requires "status": "error", "exit_code": 1, and a structured "error" object in data.

Actual behavior (from code)

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

if fmt != OutputFormat.RICH.value:
    data = _plan_spec_dict(plan)
    console.print(format_output(data, fmt))
    return

_plan_spec_dict() returns a flat dict with fields like plan_id, namespaced_name, phase, processing_state, state, project_links, arguments, etc. — completely different from the spec's required structure.

Missing from the implementation:

  1. The command/status/exit_code/data/timing/messages envelope
  2. data.progress — phase progress array (Strategize/Execute/Apply with status)
  3. data.timing — started, elapsed, ETA
  4. data.execution — sandbox, tool_calls, files_modified, child_plans, checkpoints
  5. data.cost — tokens_used, cost_so_far, estimated
  6. data.action (uses action_name instead)
  7. data.project (uses project_links array instead)
  8. data.automation (uses automation_profile object instead)
  9. data.attempt (not included)
  10. For errored plans: "status": "error", "exit_code": 1, structured "error" object

Impact

Any tooling, scripts, or integrations that parse agents plan status --format json output will receive a completely different structure than documented, breaking JSON-based automation.

Code location

  • src/cleveragents/cli/commands/plan.py, function plan_status, lines ~2170–2175
  • src/cleveragents/cli/commands/plan.py, function _plan_spec_dict, lines ~187–264

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

## Bug Report ### What was tested The `agents plan status` JSON and YAML output format vs the specification. ### Expected behavior (from spec) Per `docs/specification.md` §`agents plan status`, the JSON output must follow the standard CLI envelope format: ```json { "command": "plan status", "status": "ok", "exit_code": 0, "data": { "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J", "phase": "execute", "state": "processing", "action": "local/code-coverage", "project": "local/api-service", "automation": "review", "attempt": 1, "progress": [ { "step": "Strategize", "status": "done" }, { "step": "Execute", "status": "running" }, { "step": "Apply", "status": "queued" } ], "timing": { "started": "12:57:01", "elapsed": "00:01:12", "eta": "00:03:45" }, "execution": { "sandbox": "git_worktree", "tool_calls": 8, "files_modified": 3, "child_plans": "1/2 complete", "checkpoints": 2 }, "cost": { "tokens_used": 12420, "cost_so_far": 0.041, "estimated": 0.085 } }, "timing": { "started": "2026-02-08T12:57:01Z", "duration_ms": 120 }, "messages": ["Status refreshed"] } ``` For errored plans, the spec requires `"status": "error"`, `"exit_code": 1`, and a structured `"error"` object in `data`. ### Actual behavior (from code) In `src/cleveragents/cli/commands/plan.py` (lines 2170–2175), the JSON output is: ```python if fmt != OutputFormat.RICH.value: data = _plan_spec_dict(plan) console.print(format_output(data, fmt)) return ``` `_plan_spec_dict()` returns a flat dict with fields like `plan_id`, `namespaced_name`, `phase`, `processing_state`, `state`, `project_links`, `arguments`, etc. — completely different from the spec's required structure. **Missing from the implementation:** 1. The `command/status/exit_code/data/timing/messages` envelope 2. `data.progress` — phase progress array (Strategize/Execute/Apply with status) 3. `data.timing` — started, elapsed, ETA 4. `data.execution` — sandbox, tool_calls, files_modified, child_plans, checkpoints 5. `data.cost` — tokens_used, cost_so_far, estimated 6. `data.action` (uses `action_name` instead) 7. `data.project` (uses `project_links` array instead) 8. `data.automation` (uses `automation_profile` object instead) 9. `data.attempt` (not included) 10. For errored plans: `"status": "error"`, `"exit_code": 1`, structured `"error"` object ### Impact Any tooling, scripts, or integrations that parse `agents plan status --format json` output will receive a completely different structure than documented, breaking JSON-based automation. ### Code location - `src/cleveragents/cli/commands/plan.py`, function `plan_status`, lines ~2170–2175 - `src/cleveragents/cli/commands/plan.py`, function `_plan_spec_dict`, lines ~187–264 --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.5.0 milestone 2026-04-05 05:06:35 +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#2539
No description provided.