UAT: agents resource add/remove/list JSON/YAML output missing spec-required command envelope and data fields #6333

Open
opened 2026-04-09 20:11:19 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Spec Reference

docs/specification.md — JSON output schemas for resource commands.

agents resource add (spec lines 10862–10943):

{
  "command": "resource add",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "name": "local/api-repo",
    "id": "01HXR1A1B2C3D4E5F6G7H8J9K0",
    "type": "git-checkout",
    "physical_virtual": "physical",
    "auto_discovered_children": [...],
    "children_summary": { "git_commit": 47, ... },
    "total_children": 395,
    "capabilities": { "readable": true, "writable": true, "sandboxable": true, "checkpointable": true, "sandbox_strategy": "git_worktree" }
  },
  "timing": { ... },
  "messages": ["Resource registered (395 child resources discovered)"]
}

agents resource remove (spec lines 11000–11031):

{
  "command": "resource remove",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "name": "local/api-repo",
    "type": "git-checkout",
    "children_removed": 395,
    "projects_unlinked": 0
  },
  "timing": { ... },
  "messages": ["Resource removed"]
}

agents resource list (spec lines 11096–11178):

{
  "command": "resource list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "resources": [ { "name": ..., "id": ..., "type": ..., "physical_virtual": ..., "children": N, "projects": [...] } ],
    "summary": { "total": 3, "physical": 3, "virtual": 0, "total_children": 405 }
  },
  "timing": { ... },
  "messages": ["3 resources listed"]
}

Code Location

resource_add()/app/src/cleveragents/cli/commands/resource.py lines 791–793:

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

_resource_dict() (lines 181–198) returns only: resource_id, name, type, classification, description, location, properties, lifecycle_state, created_at, updated_at.

Missing entirely: command envelope, status, exit_code, auto_discovered_children, children_summary, total_children, capabilities, timing, messages.

resource_remove() — lines 1345–1428:
The command has no --format flag and no structured JSON/YAML output path. It only ever prints rich console text. The spec requires JSON and YAML output formats.

resource_list() — lines 817–912:

if fmt != OutputFormat.RICH.value:
    data = [_resource_dict(r) for r in resources]
    console.print(format_output(data, fmt))

Returns a flat list of resource dicts instead of the spec-required envelope with data.resources, data.summary, command, status, exit_code, timing, messages.

Steps to Reproduce

agents resource add git-checkout local/repo --path /tmp --format json
agents resource list --format json
agents resource remove local/repo --yes --format json  # flag doesn't even exist

Expected (per spec)

Full command envelope with command, status, exit_code, data, timing, messages fields.

Actual

  • resource add --format json: bare flat dict with wrong field names (resource_id instead of id, classification instead of physical_virtual, no children/capabilities/timing/messages).
  • resource list --format json: flat list of resource dicts, no envelope, no summary, wrong field names.
  • resource remove: no --format flag at all; always outputs rich text.

Note

This issue covers three commands. It parallels the pattern already reported for plan commands (e.g., #6278, #6279, #6280). The resource commands are similarly missing the standard command envelope.


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

## Bug Report ### Spec Reference `docs/specification.md` — JSON output schemas for resource commands. **`agents resource add` (spec lines 10862–10943):** ```json { "command": "resource add", "status": "ok", "exit_code": 0, "data": { "name": "local/api-repo", "id": "01HXR1A1B2C3D4E5F6G7H8J9K0", "type": "git-checkout", "physical_virtual": "physical", "auto_discovered_children": [...], "children_summary": { "git_commit": 47, ... }, "total_children": 395, "capabilities": { "readable": true, "writable": true, "sandboxable": true, "checkpointable": true, "sandbox_strategy": "git_worktree" } }, "timing": { ... }, "messages": ["Resource registered (395 child resources discovered)"] } ``` **`agents resource remove` (spec lines 11000–11031):** ```json { "command": "resource remove", "status": "ok", "exit_code": 0, "data": { "name": "local/api-repo", "type": "git-checkout", "children_removed": 395, "projects_unlinked": 0 }, "timing": { ... }, "messages": ["Resource removed"] } ``` **`agents resource list` (spec lines 11096–11178):** ```json { "command": "resource list", "status": "ok", "exit_code": 0, "data": { "resources": [ { "name": ..., "id": ..., "type": ..., "physical_virtual": ..., "children": N, "projects": [...] } ], "summary": { "total": 3, "physical": 3, "virtual": 0, "total_children": 405 } }, "timing": { ... }, "messages": ["3 resources listed"] } ``` ### Code Location **`resource_add()` — `/app/src/cleveragents/cli/commands/resource.py` lines 791–793:** ```python if fmt != OutputFormat.RICH.value: data = _resource_dict(resource) console.print(format_output(data, fmt)) ``` `_resource_dict()` (lines 181–198) returns only: `resource_id`, `name`, `type`, `classification`, `description`, `location`, `properties`, `lifecycle_state`, `created_at`, `updated_at`. Missing entirely: `command` envelope, `status`, `exit_code`, `auto_discovered_children`, `children_summary`, `total_children`, `capabilities`, `timing`, `messages`. **`resource_remove()` — lines 1345–1428:** The command has **no `--format` flag** and **no structured JSON/YAML output path**. It only ever prints rich console text. The spec requires JSON and YAML output formats. **`resource_list()` — lines 817–912:** ```python if fmt != OutputFormat.RICH.value: data = [_resource_dict(r) for r in resources] console.print(format_output(data, fmt)) ``` Returns a flat list of resource dicts instead of the spec-required envelope with `data.resources`, `data.summary`, `command`, `status`, `exit_code`, `timing`, `messages`. ### Steps to Reproduce ```bash agents resource add git-checkout local/repo --path /tmp --format json agents resource list --format json agents resource remove local/repo --yes --format json # flag doesn't even exist ``` ### Expected (per spec) Full command envelope with `command`, `status`, `exit_code`, `data`, `timing`, `messages` fields. ### Actual - `resource add --format json`: bare flat dict with wrong field names (`resource_id` instead of `id`, `classification` instead of `physical_virtual`, no children/capabilities/timing/messages). - `resource list --format json`: flat list of resource dicts, no envelope, no `summary`, wrong field names. - `resource remove`: no `--format` flag at all; always outputs rich text. ### Note This issue covers three commands. It parallels the pattern already reported for plan commands (e.g., #6278, #6279, #6280). The resource commands are similarly missing the standard command envelope. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
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#6333
No description provided.