UAT: agents plan status --format json returns raw plan dict instead of spec-required envelope — missing progress, execution, cost, timing, messages objects #6864

Open
opened 2026-04-10 03:44:55 +00:00 by HAL9000 · 0 comments
Owner

Background and Context

agents plan status is the primary command for monitoring a running or completed plan. Its JSON output is used by monitoring scripts, CI/CD pipelines, and dashboards. The spec defines a rich envelope with phase-progress steps, execution metrics, and cost information.

Current Behavior

Code at src/cleveragents/cli/commands/plan.py lines 2733–2736:

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

_plan_spec_dict(plan) returns the raw plan domain dict. This contains domain-level fields (plan_id, namespaced_name, phase, processing_state, project_links, arguments, automation_profile, action_name, strategy_actor, execution_actor, timestamps) but is missing all the spec-required enriched output objects.

Expected Behavior

Per spec §agents plan status (JSON example §13663–13703), the output must be:

{
  "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 a completed plan (§13826–13860), the data additionally includes:

  • result object with decisions_made, child_plans, artifacts, validations, total_cost
  • timing with started, finished, total_duration

Missing from current implementation:

  • Top-level envelope: command, status, exit_code, timing, messages
  • data.action (uses action_name)
  • data.project (uses project_links array)
  • data.automation (uses automation_profile object instead of profile name string)
  • data.attempt
  • data.progress array (phase step list with step and status)
  • data.timing object (plan-level timing with started, elapsed, eta)
  • data.execution object (sandbox, tool_calls, files_modified, child_plans, checkpoints)
  • data.cost object (tokens_used, cost_so_far, estimated)
  • data.result object (for completed plans)

Acceptance Criteria

  • agents plan status --format json returns an object with command, status, exit_code, data, timing, messages
  • data.progress is a list of {step, status} objects reflecting the plan's lifecycle progress
  • data.execution contains sandbox strategy, tool call count, files modified, child plan count, checkpoint count
  • data.cost contains token usage and cost information
  • For completed plans (applied state), data.result contains decisions_made, artifacts, validations, total_cost
  • Issue #6473 (already open) tracks this for the status command — this is a NEW filing that covers the full schema, not just the previously identified subset

Supporting Information

  • Spec reference: §agents plan status, JSON examples at lines 13663–13703, 13826–13860, 13964–13996
  • Code location: src/cleveragents/cli/commands/plan.py lines 2733–2736 (plan_status)
  • Prior related issue: #6473

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

## Background and Context `agents plan status` is the primary command for monitoring a running or completed plan. Its JSON output is used by monitoring scripts, CI/CD pipelines, and dashboards. The spec defines a rich envelope with phase-progress steps, execution metrics, and cost information. ## Current Behavior Code at `src/cleveragents/cli/commands/plan.py` lines 2733–2736: ```python if fmt != OutputFormat.RICH.value: data = _plan_spec_dict(plan) console.print(format_output(data, fmt)) return ``` `_plan_spec_dict(plan)` returns the raw plan domain dict. This contains domain-level fields (`plan_id`, `namespaced_name`, `phase`, `processing_state`, `project_links`, `arguments`, `automation_profile`, `action_name`, `strategy_actor`, `execution_actor`, timestamps) but is missing all the spec-required enriched output objects. ## Expected Behavior Per spec §agents plan status (JSON example §13663–13703), the output **must** be: ```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 a completed plan (§13826–13860), the `data` additionally includes: - `result` object with `decisions_made`, `child_plans`, `artifacts`, `validations`, `total_cost` - `timing` with `started`, `finished`, `total_duration` **Missing from current implementation:** - Top-level envelope: `command`, `status`, `exit_code`, `timing`, `messages` - `data.action` (uses `action_name`) - `data.project` (uses `project_links` array) - `data.automation` (uses `automation_profile` object instead of profile name string) - `data.attempt` - `data.progress` array (phase step list with `step` and `status`) - `data.timing` object (plan-level timing with `started`, `elapsed`, `eta`) - `data.execution` object (`sandbox`, `tool_calls`, `files_modified`, `child_plans`, `checkpoints`) - `data.cost` object (`tokens_used`, `cost_so_far`, `estimated`) - `data.result` object (for completed plans) ## Acceptance Criteria - `agents plan status --format json` returns an object with `command`, `status`, `exit_code`, `data`, `timing`, `messages` - `data.progress` is a list of `{step, status}` objects reflecting the plan's lifecycle progress - `data.execution` contains sandbox strategy, tool call count, files modified, child plan count, checkpoint count - `data.cost` contains token usage and cost information - For completed plans (applied state), `data.result` contains decisions_made, artifacts, validations, total_cost - Issue #6473 (already open) tracks this for the status command — this is a NEW filing that covers the full schema, not just the previously identified subset ## Supporting Information - Spec reference: §agents plan status, JSON examples at lines 13663–13703, 13826–13860, 13964–13996 - Code location: `src/cleveragents/cli/commands/plan.py` lines 2733–2736 (`plan_status`) - Prior related issue: #6473 --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 03:45:41 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:35 +00:00
HAL9000 modified the milestone from v3.4.0 to v3.2.0 2026-04-13 20:13:36 +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#6864
No description provided.