UAT: agents project context set rich output format does not match spec — single confirmation panel instead of structured multi-panel output #5061

Open
opened 2026-04-09 00:53:17 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area: ACMS and Context Management — project context set command

Severity: Medium (output format deviation, functional behavior is correct)


What Was Tested

Code-level analysis of src/cleveragents/cli/commands/project_context.pycontext_set() function (lines 395–758).


Expected Behavior (from spec)

The specification (§CLI Commands — agents project context set, lines 3800–3836) defines the following rich output format with four distinct panels:

╭─ Context Policy ────────────╮
│ Project: local/api-service  │
│ View: strategize            │
│ Include: repo               │
│ Exclude: **/node_modules/** │
╰─────────────────────────────╯

╭─ Limits ─────────────────────╮
│ Hot Tokens: 12000 (soft cap) │
│ Warm Decisions: 50           │
│ Cold Decisions: 200          │
│ Query Limit: 20              │
│ Max File Size: 1 MB          │
│ Max Total Size: 50 MB        │
╰──────────────────────────────╯

╭─ Summarization ─╮
│ Enabled: yes    │
│ Max Tokens: 800 │
╰─────────────────╯

╭─ Other Views ────────╮
│ execute: (default)   │
│ apply: (default)     │
│ default: (unset)     │
╰──────────────────────╯

✓ OK Context policy updated

The JSON/YAML output should also be wrapped in the spec-required envelope with command, status, exit_code, data, timing, and messages fields.


Actual Behavior (bug)

The implementation (lines 747–758) only renders a single confirmation panel:

if output_format.lower() == OutputFormat.RICH:
    console.print(
        Panel(
            f"[green]✓[/green] Context policy "
            f"'{view}' view updated for "
            f"project '{project}'.",
            title="Context Policy Updated",
            expand=False,
        )
    )
else:
    console.print(format_output(data, output_format))

This produces:

╭─ Context Policy Updated ─────────────────────────────────────────╮
│ ✓ Context policy 'strategize' view updated for project 'local/x' │
╰──────────────────────────────────────────────────────────────────╯

Missing:

  1. Context Policy panel — project, view, include/exclude resources, include/exclude paths
  2. Limits panel — hot max tokens, warm/cold decisions, query limit, max file/total size
  3. Summarization panel — enabled status, max tokens
  4. Other Views panel — status of the other three phase views

Additionally, the non-rich formats (--format json, --format yaml) call format_output(data, output_format) but data is the raw policy dict, not the spec-required structured payload with context_policy, limits, summarization, and other_views sub-keys.


Code Location

src/cleveragents/cli/commands/project_context.pycontext_set() function, lines 745–758


Fix Required

Replace the single confirmation panel with the four-panel output structure defined in the spec:

  1. Context Policy panel: project, view, include/exclude resources and paths
  2. Limits panel: hot_max_tokens, warm_max_decisions, cold_max_decisions, query_limit, max_file_size, max_total_size
  3. Summarization panel: summarize enabled/disabled, summary_max_tokens
  4. Other Views panel: status of the other three phase views (configured/inherits)

For JSON/YAML formats, structure the data payload as:

{
  "context_policy": { "project": "...", "view": "...", "include_resources": [...], ... },
  "limits": { "hot_max_tokens": ..., "warm_max_decisions": ..., ... },
  "summarization": { "enabled": ..., "max_tokens": ... },
  "other_views": { "execute": "...", "apply": "...", "default": "..." }
}

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

## Bug Report **Feature Area:** ACMS and Context Management — `project context set` command **Severity:** Medium (output format deviation, functional behavior is correct) --- ## What Was Tested Code-level analysis of `src/cleveragents/cli/commands/project_context.py` — `context_set()` function (lines 395–758). --- ## Expected Behavior (from spec) The specification (§CLI Commands — `agents project context set`, lines 3800–3836) defines the following rich output format with **four distinct panels**: ``` ╭─ Context Policy ────────────╮ │ Project: local/api-service │ │ View: strategize │ │ Include: repo │ │ Exclude: **/node_modules/** │ ╰─────────────────────────────╯ ╭─ Limits ─────────────────────╮ │ Hot Tokens: 12000 (soft cap) │ │ Warm Decisions: 50 │ │ Cold Decisions: 200 │ │ Query Limit: 20 │ │ Max File Size: 1 MB │ │ Max Total Size: 50 MB │ ╰──────────────────────────────╯ ╭─ Summarization ─╮ │ Enabled: yes │ │ Max Tokens: 800 │ ╰─────────────────╯ ╭─ Other Views ────────╮ │ execute: (default) │ │ apply: (default) │ │ default: (unset) │ ╰──────────────────────╯ ✓ OK Context policy updated ``` The JSON/YAML output should also be wrapped in the spec-required envelope with `command`, `status`, `exit_code`, `data`, `timing`, and `messages` fields. --- ## Actual Behavior (bug) The implementation (lines 747–758) only renders a **single confirmation panel**: ```python if output_format.lower() == OutputFormat.RICH: console.print( Panel( f"[green]✓[/green] Context policy " f"'{view}' view updated for " f"project '{project}'.", title="Context Policy Updated", expand=False, ) ) else: console.print(format_output(data, output_format)) ``` This produces: ``` ╭─ Context Policy Updated ─────────────────────────────────────────╮ │ ✓ Context policy 'strategize' view updated for project 'local/x' │ ╰──────────────────────────────────────────────────────────────────╯ ``` Missing: 1. **Context Policy panel** — project, view, include/exclude resources, include/exclude paths 2. **Limits panel** — hot max tokens, warm/cold decisions, query limit, max file/total size 3. **Summarization panel** — enabled status, max tokens 4. **Other Views panel** — status of the other three phase views Additionally, the non-rich formats (`--format json`, `--format yaml`) call `format_output(data, output_format)` but `data` is the raw policy dict, not the spec-required structured payload with `context_policy`, `limits`, `summarization`, and `other_views` sub-keys. --- ## Code Location `src/cleveragents/cli/commands/project_context.py` — `context_set()` function, lines 745–758 --- ## Fix Required Replace the single confirmation panel with the four-panel output structure defined in the spec: 1. **Context Policy** panel: project, view, include/exclude resources and paths 2. **Limits** panel: hot_max_tokens, warm_max_decisions, cold_max_decisions, query_limit, max_file_size, max_total_size 3. **Summarization** panel: summarize enabled/disabled, summary_max_tokens 4. **Other Views** panel: status of the other three phase views (configured/inherits) For JSON/YAML formats, structure the `data` payload as: ```json { "context_policy": { "project": "...", "view": "...", "include_resources": [...], ... }, "limits": { "hot_max_tokens": ..., "warm_max_decisions": ..., ... }, "summarization": { "enabled": ..., "max_tokens": ... }, "other_views": { "execute": "...", "apply": "...", "default": "..." } } ``` --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:01:45 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — Spec compliance bug; deviates from documented behavior
  • Milestone: v3.2.0
  • Story Points: 3 — M
  • MoSCoW: Must Have — Spec compliance is required

Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — Spec compliance bug; deviates from documented behavior - **Milestone**: v3.2.0 - **Story Points**: 3 — M - **MoSCoW**: Must Have — Spec compliance is required --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
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#5061
No description provided.