UAT: agents actor add/list/show --format json output uses generic data key instead of spec-required command-specific keys #5068

Open
opened 2026-04-09 00:54:01 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: Actor System — CLI JSON output format
Severity: High
Discovered by: UAT Testing (uat-pool-1, worker: Actor System)


What Was Tested

Reviewed the --format json output structure for agents actor add, agents actor list, and agents actor show against the specification's required JSON envelope format.

Expected Behavior (from spec)

The spec defines command-specific top-level keys in the JSON output envelope:

agents actor add --format json:

{
  "command": "agents actor add --config ./actors/reviewer.yaml",
  "actor_added": {
    "name": "local/reviewer",
    "provider": "anthropic",
    "model": "claude-3-5-sonnet-20241022",
    "type": "llm",
    "config": "./actors/reviewer.yaml",
    "hash": "sha256:abc123",
    "schema_version": "1.0"
  },
  "status": [{"level": "ok", "text": "✓ OK Actor added"}]
}

agents actor list --format json:

{
  "command": "agents actor list",
  "actors": [
    {"name": "local/reviewer", "provider": "anthropic", ...},
    ...
  ],
  "summary": {"total": 3, "built_in": 2, "custom": 1},
  "status": [{"level": "ok", "text": "✓ OK 3 actors listed"}]
}

agents actor show --format json:

{
  "command": "agents actor show local/reviewer",
  "actor_details": {
    "name": "local/reviewer",
    "provider": "anthropic",
    "model": "claude-3-5-sonnet-20241022",
    "config": "./actors/reviewer.yaml",
    ...
  },
  "status": [{"level": "ok", "text": "✓ OK"}]
}

Actual Behavior

All three commands use the generic "data" key from format_output() instead of the spec-required command-specific keys:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "name": "local/reviewer",
    ...
  },
  "timing": {"duration_ms": 0},
  "messages": [{"level": "ok", "text": " completed"}]
}

Code Location

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

# _print_actor() — called by add, update, show, set-default
def _print_actor(actor, title, fmt, config_path, show_add_panels):
    if fmt != OutputFormat.RICH.value:
        data = _actor_spec_dict(actor)
        console.print(format_output(data, fmt))  # ← uses generic "data" key
        return

# list_actors()
def list_actors(fmt):
    ...
    data = [_actor_spec_dict(a) for a in actors]
    console.print(format_output(data, fmt))  # ← uses generic "data" key

Impact

  • Automation scripts that parse actor_added, actors, or actor_details keys will fail
  • The JSON output structure is incompatible with the spec contract
  • Machine-readable output cannot be reliably parsed by downstream tools

Steps to Reproduce

# actor add (requires NAME positional arg per current implementation)
agents actor add local/test-actor --config ./test.yaml --format json
# Expected: {"actor_added": {...}, ...}
# Actual: {"data": {...}, ...}

agents actor list --format json
# Expected: {"actors": [...], "summary": {...}, ...}
# Actual: {"data": [...], ...}

agents actor show local/some-actor --format json
# Expected: {"actor_details": {...}, ...}
# Actual: {"data": {...}, ...}

Suggested Fix

Each command should wrap its data in the spec-required key before passing to format_output():

# actor add
format_output({"actor_added": actor_data}, fmt, command="agents actor add")

# actor list
format_output({"actors": actors_data, "summary": summary_data}, fmt, command="agents actor list")

# actor show
format_output({"actor_details": actor_data}, fmt, command="agents actor show")

Note: This is related to but distinct from issue #5015 (missing command= parameter). Both issues need to be fixed together.


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

## Bug Report **Feature Area:** Actor System — CLI JSON output format **Severity:** High **Discovered by:** UAT Testing (uat-pool-1, worker: Actor System) --- ## What Was Tested Reviewed the `--format json` output structure for `agents actor add`, `agents actor list`, and `agents actor show` against the specification's required JSON envelope format. ## Expected Behavior (from spec) The spec defines command-specific top-level keys in the JSON output envelope: **`agents actor add --format json`:** ```json { "command": "agents actor add --config ./actors/reviewer.yaml", "actor_added": { "name": "local/reviewer", "provider": "anthropic", "model": "claude-3-5-sonnet-20241022", "type": "llm", "config": "./actors/reviewer.yaml", "hash": "sha256:abc123", "schema_version": "1.0" }, "status": [{"level": "ok", "text": "✓ OK Actor added"}] } ``` **`agents actor list --format json`:** ```json { "command": "agents actor list", "actors": [ {"name": "local/reviewer", "provider": "anthropic", ...}, ... ], "summary": {"total": 3, "built_in": 2, "custom": 1}, "status": [{"level": "ok", "text": "✓ OK 3 actors listed"}] } ``` **`agents actor show --format json`:** ```json { "command": "agents actor show local/reviewer", "actor_details": { "name": "local/reviewer", "provider": "anthropic", "model": "claude-3-5-sonnet-20241022", "config": "./actors/reviewer.yaml", ... }, "status": [{"level": "ok", "text": "✓ OK"}] } ``` ## Actual Behavior All three commands use the generic `"data"` key from `format_output()` instead of the spec-required command-specific keys: ```json { "command": "", "status": "ok", "exit_code": 0, "data": { "name": "local/reviewer", ... }, "timing": {"duration_ms": 0}, "messages": [{"level": "ok", "text": " completed"}] } ``` ### Code Location `src/cleveragents/cli/commands/actor.py`: ```python # _print_actor() — called by add, update, show, set-default def _print_actor(actor, title, fmt, config_path, show_add_panels): if fmt != OutputFormat.RICH.value: data = _actor_spec_dict(actor) console.print(format_output(data, fmt)) # ← uses generic "data" key return # list_actors() def list_actors(fmt): ... data = [_actor_spec_dict(a) for a in actors] console.print(format_output(data, fmt)) # ← uses generic "data" key ``` ## Impact - Automation scripts that parse `actor_added`, `actors`, or `actor_details` keys will fail - The JSON output structure is incompatible with the spec contract - Machine-readable output cannot be reliably parsed by downstream tools ## Steps to Reproduce ```bash # actor add (requires NAME positional arg per current implementation) agents actor add local/test-actor --config ./test.yaml --format json # Expected: {"actor_added": {...}, ...} # Actual: {"data": {...}, ...} agents actor list --format json # Expected: {"actors": [...], "summary": {...}, ...} # Actual: {"data": [...], ...} agents actor show local/some-actor --format json # Expected: {"actor_details": {...}, ...} # Actual: {"data": {...}, ...} ``` ## Suggested Fix Each command should wrap its data in the spec-required key before passing to `format_output()`: ```python # actor add format_output({"actor_added": actor_data}, fmt, command="agents actor add") # actor list format_output({"actors": actors_data, "summary": summary_data}, fmt, command="agents actor list") # actor show format_output({"actor_details": actor_data}, fmt, command="agents actor show") ``` Note: This is related to but distinct from issue #5015 (missing `command=` parameter). Both issues need to be fixed together. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:01:27 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Spec compliance bug that breaks documented behavior
  • Milestone: v3.2.0
  • Story Points: 3 — M
  • MoSCoW: Must Have — Spec compliance is required

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Spec compliance bug that breaks documented behavior - **Milestone**: v3.2.0 - **Story Points**: 3 — M - **MoSCoW**: Must Have — Spec compliance is required --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
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#5068
No description provided.