UAT: agents plan list JSON/YAML output missing spec-required envelope and filters field — returns raw plan array instead #2542

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

Bug Report

What was tested

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

Expected behavior (from spec)

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

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

Key spec requirements:

  • Wrapped in command/status/exit_code/data/timing/messages envelope
  • data.plans array with compact fields: id, phase, state, action, project, elapsed
  • data.filters object showing active filter values (null when not set)
  • data.summary with total, processing, completed, errored
  • messages array with count string (e.g., "1 plan listed")

Actual behavior (from code)

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

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

This returns a raw list of _plan_spec_dict() objects — each with verbose fields like plan_id, namespaced_name, phase, processing_state, state, project_links, arguments, etc.

Missing from the implementation:

  1. The command/status/exit_code/data/timing/messages envelope
  2. data.filters — the active filter values (phase, state, project, action)
  3. data.summary — total, processing, completed, errored counts
  4. data.plans wrapper key (returns a bare list)
  5. Compact plan representation (id, action, project, elapsed vs verbose plan_id, action_name, project_links, etc.)
  6. messages array with count string

Impact

Any tooling, scripts, or integrations that parse agents plan list --format json output will receive a completely different structure than documented. In particular:

  • The filters field is entirely absent, making it impossible to verify which filters were applied
  • The messages field is absent, breaking standard envelope parsing
  • The plan objects use different field names than documented

Code location

src/cleveragents/cli/commands/plan.py, function lifecycle_list_plans, lines ~2434–2437.


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

## Bug Report ### What was tested The `agents plan list` JSON and YAML output format vs the specification. ### Expected behavior (from spec) Per `docs/specification.md` §`agents plan list`, the JSON output must follow the standard CLI envelope format: ```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"] } ``` Key spec requirements: - Wrapped in `command/status/exit_code/data/timing/messages` envelope - `data.plans` array with compact fields: `id`, `phase`, `state`, `action`, `project`, `elapsed` - `data.filters` object showing active filter values (null when not set) - `data.summary` with `total`, `processing`, `completed`, `errored` - `messages` array with count string (e.g., `"1 plan listed"`) ### Actual behavior (from code) In `src/cleveragents/cli/commands/plan.py` (lines 2434–2437), the JSON output is: ```python if fmt != OutputFormat.RICH.value: data = [_plan_spec_dict(p) for p in plans] console.print(format_output(data, fmt)) return ``` This returns a raw list of `_plan_spec_dict()` objects — each with verbose fields like `plan_id`, `namespaced_name`, `phase`, `processing_state`, `state`, `project_links`, `arguments`, etc. **Missing from the implementation:** 1. The `command/status/exit_code/data/timing/messages` envelope 2. `data.filters` — the active filter values (phase, state, project, action) 3. `data.summary` — total, processing, completed, errored counts 4. `data.plans` wrapper key (returns a bare list) 5. Compact plan representation (`id`, `action`, `project`, `elapsed` vs verbose `plan_id`, `action_name`, `project_links`, etc.) 6. `messages` array with count string ### Impact Any tooling, scripts, or integrations that parse `agents plan list --format json` output will receive a completely different structure than documented. In particular: - The `filters` field is entirely absent, making it impossible to verify which filters were applied - The `messages` field is absent, breaking standard envelope parsing - The plan objects use different field names than documented ### Code location `src/cleveragents/cli/commands/plan.py`, function `lifecycle_list_plans`, lines ~2434–2437. --- **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#2542
No description provided.