UAT: agents plan list --format json output missing spec envelope and has wrong field names #5029

Closed
opened 2026-04-09 00:49:36 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Plan Lifecycle — agents plan list

Summary

agents plan list --format json returns a raw list of plan dicts instead of the spec-required JSON envelope. The output is missing the command, status, exit_code, timing, and messages top-level fields, the data.filters section, and the data.summary section. Individual plan entries also use non-spec field names.

Expected Behavior (from spec)

Per docs/specification.md §agents plan list, the JSON output must be:

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

Note: The spec uses id (short), state, action, project, elapsed as plan fields.

Actual Behavior

In src/cleveragents/cli/commands/plan.py, the lifecycle_list_plans command (lines 2522–2771) calls [_plan_spec_dict(p) for p in plans] and passes the raw list to format_output. This produces:

  1. No top-level envelope: No command, status, exit_code, timing, messages fields — just a bare JSON array
  2. No data.filters section: The active filters are not included in JSON output
  3. No data.summary section: The summary counts are not included in JSON output
  4. Wrong plan field names:
    • plan_id (full ULID) instead of id (short 8-char prefix shown in spec)
    • action_name instead of action
    • project_links (list of objects) instead of project (string)
    • processing_state instead of state
    • No elapsed field

Additionally, the spec shows a Cancelled count in the summary for the unfiltered list, but the implementation only counts processing, completed, and errored.

Code Location

src/cleveragents/cli/commands/plan.py:

  • lifecycle_list_plans function (lines 2522–2771)
  • _plan_spec_dict function (lines 223–300)

Impact

Programmatic consumers of agents plan list --format json receive a non-spec-compliant response. Scripts that parse the output expecting data.plans[].action or data.summary.total will fail.


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

## Bug Report **Feature Area:** Plan Lifecycle — `agents plan list` ### Summary `agents plan list --format json` returns a raw list of plan dicts instead of the spec-required JSON envelope. The output is missing the `command`, `status`, `exit_code`, `timing`, and `messages` top-level fields, the `data.filters` section, and the `data.summary` section. Individual plan entries also use non-spec field names. ### Expected Behavior (from spec) Per `docs/specification.md` §agents plan list, the JSON output must be: ```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"] } ``` Note: The spec uses `id` (short), `state`, `action`, `project`, `elapsed` as plan fields. ### Actual Behavior In `src/cleveragents/cli/commands/plan.py`, the `lifecycle_list_plans` command (lines 2522–2771) calls `[_plan_spec_dict(p) for p in plans]` and passes the raw list to `format_output`. This produces: 1. **No top-level envelope**: No `command`, `status`, `exit_code`, `timing`, `messages` fields — just a bare JSON array 2. **No `data.filters` section**: The active filters are not included in JSON output 3. **No `data.summary` section**: The summary counts are not included in JSON output 4. **Wrong plan field names**: - `plan_id` (full ULID) instead of `id` (short 8-char prefix shown in spec) - `action_name` instead of `action` - `project_links` (list of objects) instead of `project` (string) - `processing_state` instead of `state` - No `elapsed` field Additionally, the spec shows a `Cancelled` count in the summary for the unfiltered list, but the implementation only counts `processing`, `completed`, and `errored`. ### Code Location `src/cleveragents/cli/commands/plan.py`: - `lifecycle_list_plans` function (lines 2522–2771) - `_plan_spec_dict` function (lines 223–300) ### Impact Programmatic consumers of `agents plan list --format json` receive a non-spec-compliant response. Scripts that parse the output expecting `data.plans[].action` or `data.summary.total` will fail. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Closing as duplicate of #4836 — both issues report the same problem: agents plan list --format json output missing spec-required envelope.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Closing as duplicate of #4836 — both issues report the same problem: `agents plan list --format json` output missing spec-required envelope. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#5029
No description provided.