UAT: agents config set --format json data schema uses wrong field names — previous_value instead of previous, config_file instead of config #6812

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

Background and Context

The specification defines an exact JSON data schema for agents config set output. The implementation uses different field names than required, making it incompatible with programmatic consumers that parse the spec-defined schema.

Current Behavior

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

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "key": "core.format",
    "value": "table",
    "previous_value": "rich",
    "source": "config_file",
    "scope": "global"
  },
  ...
}

Two field names are wrong:

  1. "previous_value" should be "previous"
  2. "source": "config_file" should be "source": "config"

Expected Behavior (from spec §agents config set)

{
  "command": "config set",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "key": "core.format",
    "previous": "rich",
    "value": "table",
    "scope": "user (~/.cleveragents)"
  },
  ...
}

The full schema from the spec (for config set core.automation-profile trusted) also includes:

{
  "data": {
    "key": "core.automation-profile",
    "value": "trusted",
    "previous": "manual",
    "source": "config",
    "scope": "global",
    "effective": {
      "sessions": "new sessions",
      "plans": "future plans (unless set)",
      "existing": "unchanged"
    },
    "saved_to": { "file": "~/.cleveragents/config.toml", "line": 8 }
  }
}

Root Cause (Code Analysis)

In src/cleveragents/cli/commands/config.py, the config_set function at lines 266–272 builds the result dict:

result: dict[str, Any] = {
    "key": normalized,
    "value": coerced,
    "previous_value": previous,   # BUG: should be "previous"
    "source": "config_file",      # BUG: should be "config"
    "scope": scope_display,
}

The correct field names from the spec are "previous" and "source": "config". Additionally, the result dict is missing the required "effective" and "saved_to" sub-objects.

Steps to Reproduce

agents config set core.format table --format json

Observe previous_value instead of previous, and config_file instead of config.

Acceptance Criteria

  • data.previous_valuedata.previous in config set JSON output
  • data.source value is "config" not "config_file" in config set JSON output
  • data.effective sub-object is present with sessions, plans, existing fields
  • data.saved_to sub-object is present with file and line fields

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

## Background and Context The specification defines an exact JSON data schema for `agents config set` output. The implementation uses different field names than required, making it incompatible with programmatic consumers that parse the spec-defined schema. ## Current Behavior When running `agents config set <key> <value> --format json`, the `data` object contains: ```json { "command": "", "status": "ok", "exit_code": 0, "data": { "key": "core.format", "value": "table", "previous_value": "rich", "source": "config_file", "scope": "global" }, ... } ``` Two field names are wrong: 1. `"previous_value"` should be `"previous"` 2. `"source": "config_file"` should be `"source": "config"` ## Expected Behavior (from spec §agents config set) ```json { "command": "config set", "status": "ok", "exit_code": 0, "data": { "key": "core.format", "previous": "rich", "value": "table", "scope": "user (~/.cleveragents)" }, ... } ``` The full schema from the spec (for `config set core.automation-profile trusted`) also includes: ```json { "data": { "key": "core.automation-profile", "value": "trusted", "previous": "manual", "source": "config", "scope": "global", "effective": { "sessions": "new sessions", "plans": "future plans (unless set)", "existing": "unchanged" }, "saved_to": { "file": "~/.cleveragents/config.toml", "line": 8 } } } ``` ## Root Cause (Code Analysis) In `src/cleveragents/cli/commands/config.py`, the `config_set` function at lines 266–272 builds the result dict: ```python result: dict[str, Any] = { "key": normalized, "value": coerced, "previous_value": previous, # BUG: should be "previous" "source": "config_file", # BUG: should be "config" "scope": scope_display, } ``` The correct field names from the spec are `"previous"` and `"source": "config"`. Additionally, the result dict is missing the required `"effective"` and `"saved_to"` sub-objects. ## Steps to Reproduce ```bash agents config set core.format table --format json ``` Observe `previous_value` instead of `previous`, and `config_file` instead of `config`. ## Acceptance Criteria - `data.previous_value` → `data.previous` in `config set` JSON output - `data.source` value is `"config"` not `"config_file"` in `config set` JSON output - `data.effective` sub-object is present with `sessions`, `plans`, `existing` fields - `data.saved_to` sub-object is present with `file` and `line` fields --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:12:31 +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#6812
No description provided.