UAT: agents config list --format json outputs flat array instead of spec-required nested object with settings, overrides, and config_file sub-objects #6816

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

Background and Context

The specification defines a specific JSON data schema for agents config list output. The implementation outputs the settings as a raw flat array, omitting the required top-level structure with settings, overrides, and config_file sub-objects.

Current Behavior

When running agents config list --format json, the data field contains a flat array:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": [
    { "key": "core.automation-profile", "value": "supervised", "source": "default", "modified": false },
    { "key": "core.format", "value": "rich", "source": "default", "modified": false },
    ...
  ]
}

Expected Behavior (from spec §agents config list)

{
  "command": "config list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "settings": [
      { "key": "core.automation-profile", "value": "trusted", "source": "config", "modified": true },
      { "key": "actor.default.invariant", "value": "local/reconciler", "source": "config", "modified": true },
      { "key": "core.log.level", "value": "FATAL", "source": "default", "modified": false }
    ],
    "overrides": { "env": null, "cli_flags": null },
    "config_file": {
      "path": "~/.cleveragents/config.toml",
      "size_bytes": 284,
      "valid": true
    }
  },
  "timing": { "started": "2026-02-08T14:33:00Z", "duration_ms": 25 },
  "messages": ["6 settings listed"]
}

The data field must be a dict (not a list) with three required sub-objects:

  1. settings — the array of config entries
  2. overrides — env var and CLI flag override status
  3. config_file — path, size, and validity of the config file

Root Cause (Code Analysis)

In src/cleveragents/cli/commands/config.py, the config_list function passes the raw list directly to format_output:

# Line 539
typer.echo(format_output(settings_list_all, fmt))

The list settings_list_all should be wrapped in a dict:

result = {
    "settings": settings_list_all,
    "overrides": {"env": None, "cli_flags": None},
    "config_file": {
        "path": str(config_file_path),
        "size_bytes": config_file_size,
        "valid": True
    }
}
typer.echo(format_output(result, fmt, command="config list"))

The same issue exists for the project-scoped path (line 468).

Steps to Reproduce

agents config list --format json
agents config list --format yaml

Observe data is a flat array instead of the required nested dict structure.

Acceptance Criteria

  • agents config list --format json data field is a dict containing settings, overrides, config_file sub-objects
  • data.settings is the array of config entries (each with key, value, source, modified)
  • data.overrides is { "env": null, "cli_flags": null } when no overrides are active
  • data.config_file contains path, size_bytes, valid fields

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

## Background and Context The specification defines a specific JSON data schema for `agents config list` output. The implementation outputs the settings as a raw flat array, omitting the required top-level structure with `settings`, `overrides`, and `config_file` sub-objects. ## Current Behavior When running `agents config list --format json`, the `data` field contains a flat array: ```json { "command": "", "status": "ok", "exit_code": 0, "data": [ { "key": "core.automation-profile", "value": "supervised", "source": "default", "modified": false }, { "key": "core.format", "value": "rich", "source": "default", "modified": false }, ... ] } ``` ## Expected Behavior (from spec §agents config list) ```json { "command": "config list", "status": "ok", "exit_code": 0, "data": { "settings": [ { "key": "core.automation-profile", "value": "trusted", "source": "config", "modified": true }, { "key": "actor.default.invariant", "value": "local/reconciler", "source": "config", "modified": true }, { "key": "core.log.level", "value": "FATAL", "source": "default", "modified": false } ], "overrides": { "env": null, "cli_flags": null }, "config_file": { "path": "~/.cleveragents/config.toml", "size_bytes": 284, "valid": true } }, "timing": { "started": "2026-02-08T14:33:00Z", "duration_ms": 25 }, "messages": ["6 settings listed"] } ``` The `data` field must be a **dict** (not a list) with three required sub-objects: 1. `settings` — the array of config entries 2. `overrides` — env var and CLI flag override status 3. `config_file` — path, size, and validity of the config file ## Root Cause (Code Analysis) In `src/cleveragents/cli/commands/config.py`, the `config_list` function passes the raw list directly to `format_output`: ```python # Line 539 typer.echo(format_output(settings_list_all, fmt)) ``` The list `settings_list_all` should be wrapped in a dict: ```python result = { "settings": settings_list_all, "overrides": {"env": None, "cli_flags": None}, "config_file": { "path": str(config_file_path), "size_bytes": config_file_size, "valid": True } } typer.echo(format_output(result, fmt, command="config list")) ``` The same issue exists for the project-scoped path (line 468). ## Steps to Reproduce ```bash agents config list --format json agents config list --format yaml ``` Observe `data` is a flat array instead of the required nested dict structure. ## Acceptance Criteria - `agents config list --format json` `data` field is a dict containing `settings`, `overrides`, `config_file` sub-objects - `data.settings` is the array of config entries (each with `key`, `value`, `source`, `modified`) - `data.overrides` is `{ "env": null, "cli_flags": null }` when no overrides are active - `data.config_file` contains `path`, `size_bytes`, `valid` fields --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:13:46 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:39 +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#6816
No description provided.