UAT: agents plan list --format json returns bare list instead of spec-required envelope — missing command, status, filters, summary, timing, messages wrapper #6863

Open
opened 2026-04-10 03:43:21 +00:00 by HAL9000 · 1 comment
Owner

Background and Context

agents plan list is the primary way to query plans. The --format json output is used by scripts to monitor running plans and filter by phase/state/project. The spec defines a precise envelope with filters and summary objects.

Current Behavior

Code at src/cleveragents/cli/commands/plan.py lines 3002–3006:

# Non-rich formats
if fmt != OutputFormat.RICH.value:
    data = [_plan_spec_dict(p) for p in plans]
    console.print(format_output(data, fmt))
    return

This outputs a raw Python list [{...}, {...}] — no wrapper object, no filters, no summary, no command/status/timing envelope.

Additionally, each plan entry in the list uses _plan_spec_dict() which has wrong field names vs spec:

  • Uses processing_state instead of state
  • Uses project_links array instead of project
  • Uses action_name instead of action
  • Uses created_at/updated_at instead of created/updated
  • Missing elapsed field

Expected Behavior

Per spec §agents plan list (JSON example §12183–12213):

{
  "command": "plan list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plans": [
      {
        "id": "01HXM7A9",
        "phase": "execute",
        "state": "processing",
        "action": "local/code-coverage",
        "project": "local/api-service",
        "elapsed": "00:01:12"
      }
    ],
    "filters": {
      "phase": "execute",
      "state": null,
      "project": null,
      "action": null
    },
    "summary": {
      "total": 1,
      "processing": 1,
      "completed": 0,
      "errored": 0
    }
  },
  "timing": { "started": "2026-02-09T14:30:00Z", "duration_ms": 95 },
  "messages": ["1 plan listed"]
}

Missing from current implementation:

  • Top-level envelope: command, status, exit_code, timing, messages
  • data wrapper object (currently returns bare list)
  • data.filters object with phase, state, project, action keys
  • data.summary object with total, processing, completed, errored keys
  • Each plan entry uses wrong field names (processing_state, project_links, action_name, created_at/updated_at)
  • Each plan entry missing id, elapsed fields
  • When no filter is active, filters object should still appear with null values (per §12182 example with --project filter)

Acceptance Criteria

  • agents plan list --format json returns an object (not a list) with command, status, exit_code, data, timing, messages
  • data.plans is the array of plan entries
  • Each plan entry has id, phase, state, action, project, elapsed fields
  • data.filters reflects the active filter values (null when not set)
  • data.summary has total, processing, completed, errored counts
  • When filtered by project (e.g. --project local/web-app), data.total appears at the data level (per §12424–12448 example)

Supporting Information

  • Spec reference: §agents plan list, JSON examples at lines 12183–12213, 12302–12324, 12424–12448
  • Code location: src/cleveragents/cli/commands/plan.py lines 3002–3006 (lifecycle_list_plans)
  • Note: The rich-format code (lines 3094–3114) correctly computes processing/completed/errored counts but this logic is not shared with the JSON output path

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

## Background and Context `agents plan list` is the primary way to query plans. The `--format json` output is used by scripts to monitor running plans and filter by phase/state/project. The spec defines a precise envelope with `filters` and `summary` objects. ## Current Behavior Code at `src/cleveragents/cli/commands/plan.py` lines 3002–3006: ```python # Non-rich formats if fmt != OutputFormat.RICH.value: data = [_plan_spec_dict(p) for p in plans] console.print(format_output(data, fmt)) return ``` This outputs a raw Python list `[{...}, {...}]` — no wrapper object, no `filters`, no `summary`, no `command`/`status`/`timing` envelope. Additionally, each plan entry in the list uses `_plan_spec_dict()` which has wrong field names vs spec: - Uses `processing_state` instead of `state` - Uses `project_links` array instead of `project` - Uses `action_name` instead of `action` - Uses `created_at`/`updated_at` instead of `created`/`updated` - Missing `elapsed` field ## Expected Behavior Per spec §agents plan list (JSON example §12183–12213): ```json { "command": "plan list", "status": "ok", "exit_code": 0, "data": { "plans": [ { "id": "01HXM7A9", "phase": "execute", "state": "processing", "action": "local/code-coverage", "project": "local/api-service", "elapsed": "00:01:12" } ], "filters": { "phase": "execute", "state": null, "project": null, "action": null }, "summary": { "total": 1, "processing": 1, "completed": 0, "errored": 0 } }, "timing": { "started": "2026-02-09T14:30:00Z", "duration_ms": 95 }, "messages": ["1 plan listed"] } ``` **Missing from current implementation:** - Top-level envelope: `command`, `status`, `exit_code`, `timing`, `messages` - `data` wrapper object (currently returns bare list) - `data.filters` object with `phase`, `state`, `project`, `action` keys - `data.summary` object with `total`, `processing`, `completed`, `errored` keys - Each plan entry uses wrong field names (`processing_state`, `project_links`, `action_name`, `created_at`/`updated_at`) - Each plan entry missing `id`, `elapsed` fields - When no filter is active, `filters` object should still appear with `null` values (per §12182 example with `--project` filter) ## Acceptance Criteria - `agents plan list --format json` returns an object (not a list) with `command`, `status`, `exit_code`, `data`, `timing`, `messages` - `data.plans` is the array of plan entries - Each plan entry has `id`, `phase`, `state`, `action`, `project`, `elapsed` fields - `data.filters` reflects the active filter values (null when not set) - `data.summary` has `total`, `processing`, `completed`, `errored` counts - When filtered by project (e.g. `--project local/web-app`), `data.total` appears at the `data` level (per §12424–12448 example) ## Supporting Information - Spec reference: §agents plan list, JSON examples at lines 12183–12213, 12302–12324, 12424–12448 - Code location: `src/cleveragents/cli/commands/plan.py` lines 3002–3006 (`lifecycle_list_plans`) - Note: The rich-format code (lines 3094–3114) correctly computes processing/completed/errored counts but this logic is not shared with the JSON output path --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 03:43:57 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — JSON output format non-compliance breaks all automated tooling and scripting. The spec defines a precise envelope structure that must be followed.
  • Milestone: v3.4.0 — Plan list/status/cancel/use are M5 features
  • MoSCoW: Must Have — Per policy, all bugs are Must Have. JSON format compliance is required for the A2A protocol integration.

This is part of a batch of related format compliance bugs (#6860, #6863, #6864, #6865) — all plan command JSON output needs to be brought into spec compliance.


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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — JSON output format non-compliance breaks all automated tooling and scripting. The spec defines a precise envelope structure that must be followed. - **Milestone**: v3.4.0 — Plan list/status/cancel/use are M5 features - **MoSCoW**: Must Have — Per policy, all bugs are Must Have. JSON format compliance is required for the A2A protocol integration. This is part of a batch of related format compliance bugs (#6860, #6863, #6864, #6865) — all plan command JSON output needs to be brought into spec compliance. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 self-assigned this 2026-04-10 06: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#6863
No description provided.