UAT: agents config set/get/list --format json always emits empty "command" field in JSON/YAML envelope #6810

Open
opened 2026-04-10 02:12:00 +00:00 by HAL9000 · 0 comments
Owner

Background and Context

The specification mandates that all JSON/YAML output produced by the CLI must be wrapped in an envelope containing command, status, exit_code, data, timing, and messages fields. The command field must contain the name of the CLI command that produced the output (e.g., "config set", "config get", "config list").

Current Behavior

When running agents config set, agents config get, or agents config list with --format json or --format yaml, the command field in the output envelope is always an empty string:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": { ... },
  ...
}

Expected Behavior (from spec)

Per the specification (§agents config set, §agents config get, §agents config list):

{
  "command": "config set",
  "status": "ok",
  "exit_code": 0,
  ...
}
{
  "command": "config get",
  "status": "ok",
  ...
}
{
  "command": "config list",
  "status": "ok",
  ...
}

Root Cause (Code Analysis)

In src/cleveragents/cli/commands/config.py, all three config commands call format_output(result, fmt) without passing the required command= keyword argument:

  • Line 275 (config_set): typer.echo(format_output(result, fmt)) — missing command="config set"
  • Line 344 (config_get): typer.echo(format_output(result, fmt)) — missing command="config get"
  • Line 468 and 539 (config_list): typer.echo(format_output(settings_list, fmt)) — missing command="config list"

The format_output() function signature defaults command="" when not provided, causing the empty command field.

Note: A similar bug was reported for version, info, and diagnostics commands in issue #6791, but this instance is separate and affects the entire config command group.

Steps to Reproduce

agents config set core.format rich --format json
agents config get core.format --format json
agents config list --format json

Acceptance Criteria

  • agents config set --format json output has "command": "config set" in the envelope
  • agents config get --format json output has "command": "config get" in the envelope
  • agents config list --format json output has "command": "config list" in the envelope
  • Same fix applies to --format yaml

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

## Background and Context The specification mandates that all JSON/YAML output produced by the CLI must be wrapped in an envelope containing `command`, `status`, `exit_code`, `data`, `timing`, and `messages` fields. The `command` field must contain the name of the CLI command that produced the output (e.g., `"config set"`, `"config get"`, `"config list"`). ## Current Behavior When running `agents config set`, `agents config get`, or `agents config list` with `--format json` or `--format yaml`, the `command` field in the output envelope is always an empty string: ```json { "command": "", "status": "ok", "exit_code": 0, "data": { ... }, ... } ``` ## Expected Behavior (from spec) Per the specification (§agents config set, §agents config get, §agents config list): ```json { "command": "config set", "status": "ok", "exit_code": 0, ... } ``` ```json { "command": "config get", "status": "ok", ... } ``` ```json { "command": "config list", "status": "ok", ... } ``` ## Root Cause (Code Analysis) In `src/cleveragents/cli/commands/config.py`, all three config commands call `format_output(result, fmt)` without passing the required `command=` keyword argument: - Line 275 (`config_set`): `typer.echo(format_output(result, fmt))` — missing `command="config set"` - Line 344 (`config_get`): `typer.echo(format_output(result, fmt))` — missing `command="config get"` - Line 468 and 539 (`config_list`): `typer.echo(format_output(settings_list, fmt))` — missing `command="config list"` The `format_output()` function signature defaults `command=""` when not provided, causing the empty `command` field. Note: A similar bug was reported for `version`, `info`, and `diagnostics` commands in issue #6791, but this instance is separate and affects the entire `config` command group. ## Steps to Reproduce ```bash agents config set core.format rich --format json agents config get core.format --format json agents config list --format json ``` ## Acceptance Criteria - `agents config set --format json` output has `"command": "config set"` in the envelope - `agents config get --format json` output has `"command": "config get"` in the envelope - `agents config list --format json` output has `"command": "config list"` in the envelope - Same fix applies to `--format yaml` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:12:08 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:40 +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#6810
No description provided.