UAT: agents config set output missing spec-required 'Effective' and 'Saved To' panels; JSON output uses wrong field names and missing fields #3503

Open
opened 2026-04-05 18:42:31 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/config-set-output-missing-panels-and-json-fields
  • Commit Message: fix(cli): add Effective and Saved To panels to config set output and fix JSON field names
  • Milestone: (none — backlog)
  • Parent Epic: #3370

Backlog note: This issue was discovered during autonomous operation
on milestone v3.6.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.

Bug Description

The specification (docs/specification.md, section "agents config set") defines a specific output format for the agents config set command that the implementation does not match. The command is missing two required Rich panels and has incorrect JSON field names.

What was tested

Code-level analysis of src/cleveragents/cli/commands/config.py — specifically the config_set() function's output rendering.

Expected behavior (from spec — Rich format)

╭─ Config Updated ──────────────────────╮
│ 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                             │
╰─────────────────────────────────────╯

✓ OK Config updated

Expected behavior (from spec — JSON format)

{
  "command": "config set",
  "status": "ok",
  "exit_code": 0,
  "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 }
  },
  "timing": { "started": "2026-02-08T14:32:00Z", "duration_ms": 30 },
  "messages": ["Config updated"]
}

Actual behavior

The implementation shows only a single "Configuration Updated" panel:

╭─ Configuration Updated ──────────────────────╮
│ Key: core.automation-profile                 │
│ Value: trusted                               │
│ Previous: (unset)                            │
│ Source: config_file                          │
│ Scope: global                                │
╰──────────────────────────────────────────────╯

Missing from Rich output:

  1. Panel title wrong: "Configuration Updated" instead of spec-required "Config Updated"
  2. Missing "Effective" panel — showing when the change takes effect (Sessions, Plans, Existing)
  3. Missing "Saved To" panel — showing the config file path and line number
  4. Missing success message: ✓ OK Config updated

Wrong/missing in JSON output:

result = {
    "key": normalized,
    "value": coerced,
    "previous_value": previous,   # ← wrong: spec requires "previous"
    "source": "config_file",      # ← wrong: spec requires "config"
    "scope": scope_display,
    # missing: "effective" object
    # missing: "saved_to" object
    # missing: standard envelope (command, status, exit_code, data, timing, messages)
}
  • previous_value should be previous (spec field name)
  • source: "config_file" should be source: "config" (spec value)
  • Missing effective object with sessions, plans, existing fields
  • Missing saved_to object with file and line fields
  • Missing standard envelope (command, status, exit_code, data, timing, messages) — this is also covered by the broader issue #3431

Code location

  • src/cleveragents/cli/commands/config.pyconfig_set() function (lines 183–289)

Steps to reproduce

  1. Run agents config set core.log.level DEBUG
  2. Observe: Only one panel shown, titled "Configuration Updated" instead of "Config Updated", no "Effective" panel, no "Saved To" panel, no success message
  3. Run agents config set core.log.level DEBUG --format json
  4. Observe: previous_value instead of previous, source: "config_file" instead of source: "config", missing effective and saved_to fields, no standard envelope

Subtasks

  • Rename Rich panel title from "Configuration Updated" to "Config Updated" per spec
  • Add "Effective" Rich panel to config_set() output showing Sessions, Plans, and Existing fields
  • Add "Saved To" Rich panel to config_set() output showing File and Line fields
  • Add ✓ OK Config updated success message
  • Fix JSON previous_value field name to previous per spec
  • Fix JSON source value from "config_file" to "config" per spec
  • Add effective nested object to JSON result dict (sessions, plans, existing)
  • Add saved_to nested object to JSON result dict (file, line)
  • Wrap JSON result in standard output envelope (command, status, exit_code, data, timing, messages) — coordinate with #3431
  • Write BDD scenarios in features/ covering all Rich panels and JSON field names
  • Ensure all nox stages pass

Definition of Done

  • agents config set Rich output renders all three panels: "Config Updated", "Effective", and "Saved To"
  • Panel title is "Config Updated" (not "Configuration Updated")
  • "Effective" panel shows Sessions, Plans, Existing fields
  • "Saved To" panel shows File and Line fields
  • ✓ OK Config updated success message is shown
  • agents config set --format json returns previous (not previous_value) field
  • agents config set --format json returns source: "config" (not "config_file")
  • JSON data object contains effective and saved_to fields
  • BDD scenarios cover both Rich and JSON output paths
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/config-set-output-missing-panels-and-json-fields` - **Commit Message**: `fix(cli): add Effective and Saved To panels to config set output and fix JSON field names` - **Milestone**: *(none — backlog)* - **Parent Epic**: #3370 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.6.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. ## Bug Description The specification (`docs/specification.md`, section "agents config set") defines a specific output format for the `agents config set` command that the implementation does not match. The command is missing two required Rich panels and has incorrect JSON field names. ### What was tested Code-level analysis of `src/cleveragents/cli/commands/config.py` — specifically the `config_set()` function's output rendering. ### Expected behavior (from spec — Rich format) ``` ╭─ Config Updated ──────────────────────╮ │ 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 │ ╰─────────────────────────────────────╯ ✓ OK Config updated ``` ### Expected behavior (from spec — JSON format) ```json { "command": "config set", "status": "ok", "exit_code": 0, "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 } }, "timing": { "started": "2026-02-08T14:32:00Z", "duration_ms": 30 }, "messages": ["Config updated"] } ``` ### Actual behavior The implementation shows only a single "Configuration Updated" panel: ``` ╭─ Configuration Updated ──────────────────────╮ │ Key: core.automation-profile │ │ Value: trusted │ │ Previous: (unset) │ │ Source: config_file │ │ Scope: global │ ╰──────────────────────────────────────────────╯ ``` **Missing from Rich output:** 1. **Panel title wrong**: "Configuration Updated" instead of spec-required "Config Updated" 2. **Missing "Effective" panel** — showing when the change takes effect (Sessions, Plans, Existing) 3. **Missing "Saved To" panel** — showing the config file path and line number 4. **Missing success message**: `✓ OK Config updated` **Wrong/missing in JSON output:** ```python result = { "key": normalized, "value": coerced, "previous_value": previous, # ← wrong: spec requires "previous" "source": "config_file", # ← wrong: spec requires "config" "scope": scope_display, # missing: "effective" object # missing: "saved_to" object # missing: standard envelope (command, status, exit_code, data, timing, messages) } ``` - `previous_value` should be `previous` (spec field name) - `source: "config_file"` should be `source: "config"` (spec value) - Missing `effective` object with `sessions`, `plans`, `existing` fields - Missing `saved_to` object with `file` and `line` fields - Missing standard envelope (`command`, `status`, `exit_code`, `data`, `timing`, `messages`) — this is also covered by the broader issue #3431 ### Code location - `src/cleveragents/cli/commands/config.py` — `config_set()` function (lines 183–289) ### Steps to reproduce 1. Run `agents config set core.log.level DEBUG` 2. Observe: Only one panel shown, titled "Configuration Updated" instead of "Config Updated", no "Effective" panel, no "Saved To" panel, no success message 3. Run `agents config set core.log.level DEBUG --format json` 4. Observe: `previous_value` instead of `previous`, `source: "config_file"` instead of `source: "config"`, missing `effective` and `saved_to` fields, no standard envelope ## Subtasks - [ ] Rename Rich panel title from "Configuration Updated" to "Config Updated" per spec - [ ] Add "Effective" Rich panel to `config_set()` output showing `Sessions`, `Plans`, and `Existing` fields - [ ] Add "Saved To" Rich panel to `config_set()` output showing `File` and `Line` fields - [ ] Add `✓ OK Config updated` success message - [ ] Fix JSON `previous_value` field name to `previous` per spec - [ ] Fix JSON `source` value from `"config_file"` to `"config"` per spec - [ ] Add `effective` nested object to JSON result dict (`sessions`, `plans`, `existing`) - [ ] Add `saved_to` nested object to JSON result dict (`file`, `line`) - [ ] Wrap JSON result in standard output envelope (`command`, `status`, `exit_code`, `data`, `timing`, `messages`) — coordinate with #3431 - [ ] Write BDD scenarios in `features/` covering all Rich panels and JSON field names - [ ] Ensure all nox stages pass ## Definition of Done - [ ] `agents config set` Rich output renders all three panels: "Config Updated", "Effective", and "Saved To" - [ ] Panel title is "Config Updated" (not "Configuration Updated") - [ ] "Effective" panel shows Sessions, Plans, Existing fields - [ ] "Saved To" panel shows File and Line fields - [ ] `✓ OK Config updated` success message is shown - [ ] `agents config set --format json` returns `previous` (not `previous_value`) field - [ ] `agents config set --format json` returns `source: "config"` (not `"config_file"`) - [ ] JSON `data` object contains `effective` and `saved_to` fields - [ ] BDD scenarios cover both Rich and JSON output paths - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-05 20:36:10 +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.

Reference
cleveragents/cleveragents-core#3503
No description provided.