UAT: agents config set rich output missing spec-required 'Effective' and 'Saved To' panels; JSON output uses wrong field names and missing standard envelope #3414

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

Metadata

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

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.

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": "...", "duration_ms": 30 },
  "messages": ["Config updated"]
}

Actual behavior

The implementation only shows 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. "Effective" panel — showing when the change takes effect (sessions, plans, existing)
  2. "Saved To" panel — showing which file was written and at which line

Wrong/missing in JSON output:

result = {
    "key": normalized,
    "value": coerced,
    "previous_value": previous,  # WRONG: spec says "previous"
    "source": "config_file",     # WRONG: spec says "config"
    "scope": scope_display,
}
  • previous_value should be previous
  • source value is "config_file" but spec says "config"
  • Missing effective field
  • Missing saved_to field
  • Missing standard envelope (command, status, exit_code, timing, messages)

Code location

  • src/cleveragents/cli/commands/config.pyconfig_set() function (around line 150–230)

Steps to reproduce

  1. Run agents config set core.log.level DEBUG
  2. Observe: Only one panel shown, no "Effective" or "Saved To" panels
  3. Run agents config set core.log.level DEBUG --format json
  4. Observe: Wrong field names, missing fields, no standard envelope

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.

Subtasks

  • 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
  • Rename previous_valueprevious in the JSON result dict
  • Change source value from "config_file" to "config" in the JSON result dict
  • Add effective nested object to JSON result dict
  • Add saved_to nested object to JSON result dict
  • Wrap JSON result in standard output envelope (command, status, exit_code, data, timing, messages)
  • Write BDD scenarios in features/ covering all Rich panel output and JSON envelope fields
  • 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") per spec
  • source field value is "config" (not "config_file") per spec
  • agents config set --format json returns the full standard envelope with command, status, exit_code, data, timing, and messages
  • JSON data object contains previous (not previous_value), 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-uat-tester

## Metadata - **Branch**: `fix/config-set-output-missing-panels-and-envelope` - **Commit Message**: `fix(cli): add missing Effective/Saved To panels and fix JSON envelope in config set output` - **Milestone**: *(none — backlog)* - **Parent Epic**: #3370 ## 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. ### 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": "...", "duration_ms": 30 }, "messages": ["Config updated"] } ``` ### Actual behavior The implementation only shows 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. **"Effective" panel** — showing when the change takes effect (`sessions`, `plans`, `existing`) 2. **"Saved To" panel** — showing which file was written and at which line **Wrong/missing in JSON output:** ```python result = { "key": normalized, "value": coerced, "previous_value": previous, # WRONG: spec says "previous" "source": "config_file", # WRONG: spec says "config" "scope": scope_display, } ``` - `previous_value` should be `previous` - `source` value is `"config_file"` but spec says `"config"` - Missing `effective` field - Missing `saved_to` field - Missing standard envelope (`command`, `status`, `exit_code`, `timing`, `messages`) ### Code location - `src/cleveragents/cli/commands/config.py` — `config_set()` function (around line 150–230) ### Steps to reproduce 1. Run `agents config set core.log.level DEBUG` 2. Observe: Only one panel shown, no "Effective" or "Saved To" panels 3. Run `agents config set core.log.level DEBUG --format json` 4. Observe: Wrong field names, missing fields, no standard envelope > **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. ## Subtasks - [ ] 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 - [ ] Rename `previous_value` → `previous` in the JSON result dict - [ ] Change `source` value from `"config_file"` to `"config"` in the JSON result dict - [ ] Add `effective` nested object to JSON result dict - [ ] Add `saved_to` nested object to JSON result dict - [ ] Wrap JSON result in standard output envelope (`command`, `status`, `exit_code`, `data`, `timing`, `messages`) - [ ] Write BDD scenarios in `features/` covering all Rich panel output and JSON envelope fields - [ ] 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") per spec - [ ] `source` field value is `"config"` (not `"config_file"`) per spec - [ ] `agents config set --format json` returns the full standard envelope with `command`, `status`, `exit_code`, `data`, `timing`, and `messages` - [ ] JSON `data` object contains `previous` (not `previous_value`), `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-uat-tester
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#3414
No description provided.