UAT: agents config get --format json data schema missing overridden, origin, and winner fields; resolution_chain omitted by default #6814

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

Background and Context

The specification defines a complete JSON data schema for agents config get output. The implementation's JSON output is missing several required fields, and the resolution_chain is gated behind a --verbose flag when the spec shows it should be present by default.

Current Behavior

When running agents config get <key> --format json, the data object contains:

{
  "data": {
    "key": "core.automation-profile",
    "value": "trusted",
    "source": "config",
    "type": "str"
  }
}

Missing required fields: overridden, origin (with file, line, default), resolution_chain, winner.

When --verbose is added, resolution_chain appears — but the spec shows it should always be present, not gated behind a flag.

Expected Behavior (from spec §agents config get)

{
  "command": "config get",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "key": "core.automation-profile",
    "value": "trusted",
    "source": "config",
    "overridden": false,
    "type": "string",
    "origin": {
      "file": "~/.cleveragents/config.toml",
      "line": 8,
      "default": "supervised"
    },
    "resolution_chain": [
      { "level": 1, "source": "CLI flag", "value": null },
      { "level": 2, "source": "Env var", "value": null },
      { "level": 3, "source": "Config file", "value": "trusted" },
      { "level": 4, "source": "Default", "value": "supervised" }
    ],
    "winner": { "source": "config file", "level": 3 }
  },
  "timing": { "started": "2026-02-08T14:33:00Z", "duration_ms": 20 },
  "messages": ["Config read"]
}

Root Cause (Code Analysis)

In src/cleveragents/cli/commands/config.py, the config_get function (lines 328–335) only includes resolution_chain when verbose=True:

result: dict[str, Any] = {
    "key": normalized,
    "value": resolved.value,
    "source": resolved.source.value,
    "type": type(resolved.value).__name__ if resolved.value is not None else "None",
}
if verbose:
    result["resolution_chain"] = resolved.chain  # Only added with --verbose!

The spec does not make these fields optional in JSON output — all fields in the JSON schema are required regardless of verbosity mode.

Additionally:

  • "overridden" boolean field is absent
  • "origin" sub-object (with file, line, default) is absent
  • "winner" sub-object is absent
  • "resolution_chain" requires a full 4-level chain with level, source, value — but the current implementation may only return what ConfigService.resolve(verbose=True) provides

Steps to Reproduce

agents config get core.automation-profile --format json
agents config get core.format --format json

Observe missing overridden, origin, resolution_chain, winner fields.

Acceptance Criteria

  • agents config get --format json always includes overridden boolean field
  • agents config get --format json always includes origin object with file, line, default fields
  • agents config get --format json always includes resolution_chain array with level, source, value entries (not gated on --verbose)
  • agents config get --format json always includes winner object with source and level fields

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

## Background and Context The specification defines a complete JSON data schema for `agents config get` output. The implementation's JSON output is missing several required fields, and the `resolution_chain` is gated behind a `--verbose` flag when the spec shows it should be present by default. ## Current Behavior When running `agents config get <key> --format json`, the `data` object contains: ```json { "data": { "key": "core.automation-profile", "value": "trusted", "source": "config", "type": "str" } } ``` Missing required fields: `overridden`, `origin` (with `file`, `line`, `default`), `resolution_chain`, `winner`. When `--verbose` is added, `resolution_chain` appears — but the spec shows it should always be present, not gated behind a flag. ## Expected Behavior (from spec §agents config get) ```json { "command": "config get", "status": "ok", "exit_code": 0, "data": { "key": "core.automation-profile", "value": "trusted", "source": "config", "overridden": false, "type": "string", "origin": { "file": "~/.cleveragents/config.toml", "line": 8, "default": "supervised" }, "resolution_chain": [ { "level": 1, "source": "CLI flag", "value": null }, { "level": 2, "source": "Env var", "value": null }, { "level": 3, "source": "Config file", "value": "trusted" }, { "level": 4, "source": "Default", "value": "supervised" } ], "winner": { "source": "config file", "level": 3 } }, "timing": { "started": "2026-02-08T14:33:00Z", "duration_ms": 20 }, "messages": ["Config read"] } ``` ## Root Cause (Code Analysis) In `src/cleveragents/cli/commands/config.py`, the `config_get` function (lines 328–335) only includes `resolution_chain` when `verbose=True`: ```python result: dict[str, Any] = { "key": normalized, "value": resolved.value, "source": resolved.source.value, "type": type(resolved.value).__name__ if resolved.value is not None else "None", } if verbose: result["resolution_chain"] = resolved.chain # Only added with --verbose! ``` The spec does not make these fields optional in JSON output — all fields in the JSON schema are required regardless of verbosity mode. Additionally: - `"overridden"` boolean field is absent - `"origin"` sub-object (with `file`, `line`, `default`) is absent - `"winner"` sub-object is absent - `"resolution_chain"` requires a full 4-level chain with `level`, `source`, `value` — but the current implementation may only return what `ConfigService.resolve(verbose=True)` provides ## Steps to Reproduce ```bash agents config get core.automation-profile --format json agents config get core.format --format json ``` Observe missing `overridden`, `origin`, `resolution_chain`, `winner` fields. ## Acceptance Criteria - `agents config get --format json` always includes `overridden` boolean field - `agents config get --format json` always includes `origin` object with `file`, `line`, `default` fields - `agents config get --format json` always includes `resolution_chain` array with level, source, value entries (not gated on `--verbose`) - `agents config get --format json` always includes `winner` object with `source` and `level` 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:03 +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#6814
No description provided.