UAT: agents plan use JSON/YAML output missing spec-required envelope, inputs, actors, automation, context, next_steps sections #2556

Open
opened 2026-04-03 18:53:31 +00:00 by freemo · 2 comments
Owner

Bug Report

What was tested

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

Expected behavior (from spec)

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

{
  "command": "plan use",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J",
    "phase": "strategize",
    "action": "local/code-coverage",
    "project": "local/api-service",
    "automation_profile": "trusted",
    "attempt": 1,
    "inputs": {
      "target_coverage_percent": 85,
      "automation_profile": "trusted"
    },
    "actors": {
      "strategy": "local/strategist",
      "execution": "local/executor",
      "estimation": null
    },
    "automation": {
      "profile": "trusted",
      "source": "CLI flag",
      "read_only": false
    },
    "context": {
      "resources": 2,
      "indexed_files": 347,
      "view": "strategize",
      "hot_token_budget": 12000
    },
    "next_steps": [
      "agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J",
      "agents plan status 01HXM8C2ZK4Q7C2B3F2R4VYV6J",
      "agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J"
    ]
  },
  "timing": { "started": "2026-02-09T14:30:00Z", "duration_ms": 95 },
  "messages": ["Plan created"]
}

Actual behavior (from code)

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

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

_plan_spec_dict() returns a flat dict with verbose plan fields — completely different from the spec's required structure.

Missing from the implementation:

  1. The command/status/exit_code/data/timing/messages envelope
  2. data.inputs — the argument values passed to the action
  3. data.actors — strategy, execution, estimation actors (structured)
  4. data.automation — profile, source, read_only
  5. data.context — resources, indexed_files, view, hot_token_budget
  6. data.next_steps — list of suggested next commands with the plan ID
  7. data.attempt — attempt counter
  8. data.action (uses action_name instead)
  9. data.project (uses project_links array instead)
  10. messages array with "Plan created"

Note

PR #1514 addresses the rich output format for plan use. This issue specifically covers the JSON/YAML output format which is a separate concern.

Code location

src/cleveragents/cli/commands/plan.py, function use_action, lines ~1705–1709.


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

## Bug Report ### What was tested The `agents plan use` JSON and YAML output format vs the specification. ### Expected behavior (from spec) Per `docs/specification.md` §`agents plan use`, the JSON output must be: ```json { "command": "plan use", "status": "ok", "exit_code": 0, "data": { "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J", "phase": "strategize", "action": "local/code-coverage", "project": "local/api-service", "automation_profile": "trusted", "attempt": 1, "inputs": { "target_coverage_percent": 85, "automation_profile": "trusted" }, "actors": { "strategy": "local/strategist", "execution": "local/executor", "estimation": null }, "automation": { "profile": "trusted", "source": "CLI flag", "read_only": false }, "context": { "resources": 2, "indexed_files": 347, "view": "strategize", "hot_token_budget": 12000 }, "next_steps": [ "agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J", "agents plan status 01HXM8C2ZK4Q7C2B3F2R4VYV6J", "agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J" ] }, "timing": { "started": "2026-02-09T14:30:00Z", "duration_ms": 95 }, "messages": ["Plan created"] } ``` ### Actual behavior (from code) In `src/cleveragents/cli/commands/plan.py` (lines 1705–1709), the JSON output is: ```python if fmt != OutputFormat.RICH.value: data = _plan_spec_dict(plan) console.print(format_output(data, fmt)) ``` `_plan_spec_dict()` returns a flat dict with verbose plan fields — completely different from the spec's required structure. **Missing from the implementation:** 1. The `command/status/exit_code/data/timing/messages` envelope 2. `data.inputs` — the argument values passed to the action 3. `data.actors` — strategy, execution, estimation actors (structured) 4. `data.automation` — profile, source, read_only 5. `data.context` — resources, indexed_files, view, hot_token_budget 6. `data.next_steps` — list of suggested next commands with the plan ID 7. `data.attempt` — attempt counter 8. `data.action` (uses `action_name` instead) 9. `data.project` (uses `project_links` array instead) 10. `messages` array with "Plan created" ### Note PR #1514 addresses the rich output format for `plan use`. This issue specifically covers the JSON/YAML output format which is a separate concern. ### Code location `src/cleveragents/cli/commands/plan.py`, function `use_action`, lines ~1705–1709. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • MoSCoW: Should Have

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

Issue triaged by project owner: - **State**: Verified - **MoSCoW**: Should Have --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
freemo added this to the v3.5.0 milestone 2026-04-05 05:09:43 +00:00
Author
Owner

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.

This issue has been moved to the backlog as part of an aggressive grooming of the v3.5.0 milestone. It has been deemed non-critical for the minimal viability of the milestone and will be addressed in a future release.
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#2556
No description provided.