UAT: agents plan status --format json does not produce spec-required JSON envelope #4974

Open
opened 2026-04-08 23:41:37 +00:00 by freemo · 1 comment
Owner

Bug Report

Feature Area: Plan Lifecycle — agents plan status
Severity: High
Discovered by: UAT tester (uat-worker-plan-lifecycle)

What Was Tested

The JSON output format of agents plan status <PLAN_ID> --format json.

Expected Behavior (from spec §agents plan status)

The spec requires a structured JSON envelope with execution progress details:

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

Actual Behavior (from code analysis)

The plan_status command at src/cleveragents/cli/commands/plan.py line 2386-2388 outputs _plan_spec_dict(plan) when fmt != "rich":

data = _plan_spec_dict(plan)
console.print(format_output(data, fmt))

_plan_spec_dict() returns the internal plan representation and is missing all spec-required status-specific fields:

  • data.action (uses action_name instead)
  • data.project (uses project_links list instead)
  • data.automation (missing — should be the profile name string)
  • data.attempt (missing)
  • data.progress (missing — should show Strategize/Execute/Apply step statuses)
  • data.timing (missing — should contain started/elapsed/eta)
  • data.execution (missing — sandbox/tool_calls/files_modified/child_plans/checkpoints)
  • data.cost (missing — tokens_used/cost_so_far/estimated)
  • command, status, exit_code, timing, messages envelope (missing)

Code Location

  • src/cleveragents/cli/commands/plan.py, lines 2386-2388 (plan_status function)

Steps to Reproduce

agents plan status <PLAN_ID> --format json

Impact

Any tooling or scripts that parse agents plan status --format json output will fail. The progress, execution, and cost fields are particularly important for monitoring dashboards and automation scripts.


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

## Bug Report **Feature Area**: Plan Lifecycle — `agents plan status` **Severity**: High **Discovered by**: UAT tester (uat-worker-plan-lifecycle) ### What Was Tested The JSON output format of `agents plan status <PLAN_ID> --format json`. ### Expected Behavior (from spec §agents plan status) The spec requires a structured JSON envelope with execution progress details: ```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"] } ``` ### Actual Behavior (from code analysis) The `plan_status` command at `src/cleveragents/cli/commands/plan.py` line 2386-2388 outputs `_plan_spec_dict(plan)` when `fmt != "rich"`: ```python data = _plan_spec_dict(plan) console.print(format_output(data, fmt)) ``` `_plan_spec_dict()` returns the internal plan representation and is missing all spec-required status-specific fields: - `data.action` (uses `action_name` instead) - `data.project` (uses `project_links` list instead) - `data.automation` (missing — should be the profile name string) - `data.attempt` (missing) - `data.progress` (missing — should show Strategize/Execute/Apply step statuses) - `data.timing` (missing — should contain started/elapsed/eta) - `data.execution` (missing — sandbox/tool_calls/files_modified/child_plans/checkpoints) - `data.cost` (missing — tokens_used/cost_so_far/estimated) - `command`, `status`, `exit_code`, `timing`, `messages` envelope (missing) ### Code Location - `src/cleveragents/cli/commands/plan.py`, lines 2386-2388 (`plan_status` function) ### Steps to Reproduce ```bash agents plan status <PLAN_ID> --format json ``` ### Impact Any tooling or scripts that parse `agents plan status --format json` output will fail. The `progress`, `execution`, and `cost` fields are particularly important for monitoring dashboards and automation scripts. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 00:53:18 +00:00
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — JSON output envelope is required by the spec for all CLI commands; missing envelope breaks any tooling or scripts parsing CLI output
  • Milestone: v3.2.0 (plan commands are core plan lifecycle)
  • Story Points: 3 — M — Fix requires wrapping existing output in the standard JSON envelope
  • MoSCoW: Must Have — The spec explicitly requires the JSON envelope format for all --format json output; this is a spec compliance bug
  • Parent Epic: #4958 (Decision Recording Epic covers plan output formats)

This is a valid spec compliance bug. Part of a batch of JSON envelope bugs across plan commands (see also #4964, #4969, #4970, #4974, #4975, #4976).


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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — JSON output envelope is required by the spec for all CLI commands; missing envelope breaks any tooling or scripts parsing CLI output - **Milestone**: v3.2.0 (plan commands are core plan lifecycle) - **Story Points**: 3 — M — Fix requires wrapping existing output in the standard JSON envelope - **MoSCoW**: Must Have — The spec explicitly requires the JSON envelope format for all `--format json` output; this is a spec compliance bug - **Parent Epic**: #4958 (Decision Recording Epic covers plan output formats) This is a valid spec compliance bug. Part of a batch of JSON envelope bugs across plan commands (see also #4964, #4969, #4970, #4974, #4975, #4976). --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

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