UAT: PersonaBar widget shows 4 segments instead of spec-required 5 (missing session cost) #10299

Open
opened 2026-04-18 08:26:21 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit message: fix(tui): add session cost segment to PersonaBar widget
  • Branch name: bugfix/m8-persona-bar-missing-session-cost

Background and Context

The TUI specification (ADR-045, Persona System) requires the PersonaBar widget to display 5 segments: active persona name, actor name, active preset, scope references, and session cost.

The current implementation in src/cleveragents/tui/widgets/persona_bar.py only renders 4 segments, omitting the session cost entirely:

def set_content(
    self,
    *,
    persona_name: str,
    actor_name: str,
    preset_name: str,
    scope_text: str,
) -> None:
    self.update(f"{persona_name} | {actor_name} | {preset_name} | {scope_text}")

The set_content() method has no session_cost parameter and the format string produces only 4 pipe-separated segments. The _refresh_persona_bar() method in app.py also does not pass a session cost value.

Expected Behavior

Per the spec, PersonaBar must display 5 segments:

  1. Active persona name
  2. Actor name
  3. Active preset name
  4. Scope reference count
  5. Session cost (e.g., $0.00 or $0.0042)

The rendered bar should look like:

my-persona | anthropic/claude-4-sonnet | default | 2 scope refs | $0.00

Actual Behavior

The PersonaBar renders only 4 segments:

my-persona | anthropic/claude-4-sonnet | default | 2 scope refs

Session cost is completely absent from the display.

Steps to Reproduce

  1. Inspect src/cleveragents/tui/widgets/persona_bar.pyset_content() has no session_cost parameter
  2. Inspect src/cleveragents/tui/app.py_refresh_persona_bar() does not compute or pass session cost
  3. Launch the TUI and observe the persona bar shows only 4 segments

Acceptance Criteria

  • PersonaBar.set_content() accepts a session_cost parameter (e.g., str formatted as $X.XXXX)
  • The rendered bar displays 5 pipe-separated segments including session cost
  • _refresh_persona_bar() in app.py computes and passes the session cost to set_content()
  • Session cost displays as $0.00 when no tokens have been consumed
  • All existing tests continue to pass
  • Coverage >= 97%

Subtasks

  • Add session_cost: str parameter to PersonaBar.set_content() in src/cleveragents/tui/widgets/persona_bar.py
  • Update the format string in set_content() to include the session cost as the 5th segment
  • Update _refresh_persona_bar() in src/cleveragents/tui/app.py to compute and pass session cost
  • Add/update Behave scenarios asserting the 5-segment PersonaBar layout
  • Implement step definitions for the new assertions
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit message:** `fix(tui): add session cost segment to PersonaBar widget` - **Branch name:** `bugfix/m8-persona-bar-missing-session-cost` ## Background and Context The TUI specification (ADR-045, Persona System) requires the `PersonaBar` widget to display **5 segments**: active persona name, actor name, active preset, scope references, and **session cost**. The current implementation in `src/cleveragents/tui/widgets/persona_bar.py` only renders **4 segments**, omitting the session cost entirely: ```python def set_content( self, *, persona_name: str, actor_name: str, preset_name: str, scope_text: str, ) -> None: self.update(f"{persona_name} | {actor_name} | {preset_name} | {scope_text}") ``` The `set_content()` method has no `session_cost` parameter and the format string produces only 4 pipe-separated segments. The `_refresh_persona_bar()` method in `app.py` also does not pass a session cost value. ## Expected Behavior Per the spec, `PersonaBar` must display 5 segments: 1. Active persona name 2. Actor name 3. Active preset name 4. Scope reference count 5. **Session cost** (e.g., `$0.00` or `$0.0042`) The rendered bar should look like: ``` my-persona | anthropic/claude-4-sonnet | default | 2 scope refs | $0.00 ``` ## Actual Behavior The `PersonaBar` renders only 4 segments: ``` my-persona | anthropic/claude-4-sonnet | default | 2 scope refs ``` Session cost is completely absent from the display. ## Steps to Reproduce 1. Inspect `src/cleveragents/tui/widgets/persona_bar.py` — `set_content()` has no `session_cost` parameter 2. Inspect `src/cleveragents/tui/app.py` — `_refresh_persona_bar()` does not compute or pass session cost 3. Launch the TUI and observe the persona bar shows only 4 segments ## Acceptance Criteria - [ ] `PersonaBar.set_content()` accepts a `session_cost` parameter (e.g., `str` formatted as `$X.XXXX`) - [ ] The rendered bar displays 5 pipe-separated segments including session cost - [ ] `_refresh_persona_bar()` in `app.py` computes and passes the session cost to `set_content()` - [ ] Session cost displays as `$0.00` when no tokens have been consumed - [ ] All existing tests continue to pass - [ ] Coverage >= 97% ## Subtasks - [ ] Add `session_cost: str` parameter to `PersonaBar.set_content()` in `src/cleveragents/tui/widgets/persona_bar.py` - [ ] Update the format string in `set_content()` to include the session cost as the 5th segment - [ ] Update `_refresh_persona_bar()` in `src/cleveragents/tui/app.py` to compute and pass session cost - [ ] Add/update Behave scenarios asserting the 5-segment PersonaBar layout - [ ] Implement step definitions for the new assertions - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
HAL9000 added this to the v3.7.0 milestone 2026-04-18 08:41:39 +00:00
Author
Owner

[GROOMED] Quality Analysis Report

Issue Validity: VALID & ACTIONABLE

This is a well-documented Priority/Critical UAT bug with clear specifications, acceptance criteria, and actionable subtasks. The issue is valid and ready for implementation.

Label Compliance Check

Current Labels:

  • State/Unverified (id: 846)
  • Type/Bug (id: 849)
  • Priority/Critical (id: 858)
  • MoSCoW/Must have (id: 883)

Status: All required labels present (State/, Type/, Priority/). MoSCoW label is present (assumed pre-approved by AUTO-OWNR).

Triage Assessment

Recommendation: Move from State/Unverified → State/Verified

Rationale:

  • Issue is clearly valid and actionable
  • Detailed specification provided (ADR-045, Persona System)
  • Clear acceptance criteria and subtasks
  • Well-scoped implementation path
  • No blockers or dependencies identified

Milestone Assignment

Status: ASSIGNED to v3.7.0 (M8: TUI Implementation)

This is the correct milestone as the issue concerns the PersonaBar widget, a core TUI component.

Priority/Critical Flag 🚨

CRITICAL ATTENTION REQUIRED:

  • This is a Priority/Critical issue currently in State/Unverified
  • Per CONTRIBUTING.md: Priority/Critical issues with no State/In Progress should be flagged for attention
  • Recommended Action: Once verified, assign to a developer and move to State/In Progress immediately
  • No assignee currently set — needs assignment upon verification

Technical Summary

Problem: PersonaBar widget renders 4 segments instead of spec-required 5 (missing session cost)

Root Cause:

  • PersonaBar.set_content() in src/cleveragents/tui/widgets/persona_bar.py lacks session_cost parameter
  • _refresh_persona_bar() in src/cleveragents/tui/app.py does not compute/pass session cost

Solution Scope:

  1. Add session_cost: str parameter to PersonaBar.set_content()
  2. Update format string to include 5th segment
  3. Compute and pass session cost from _refresh_persona_bar()
  4. Add/update Behave scenarios
  5. Maintain coverage ≥ 97%

Grooming Checklist

  • Issue validity assessed
  • All required labels present
  • Milestone assigned (v3.7.0)
  • Priority/Critical flagged
  • ⚠️ State label update pending (API restriction)
  • No blockers identified
  • Ready for assignment and implementation

Next Steps

  1. Manual Action Required: Update State/Unverified → State/Verified (label API restricted)
  2. Assign to Developer: Once verified, assign to appropriate team member
  3. Move to In Progress: Update State/Verified → State/In Progress when work begins
  4. Implementation: Follow subtasks and acceptance criteria in issue description

Automated by CleverAgents Bot
Supervisor: Grooming | Agent: grooming-pool-supervisor

## [GROOMED] Quality Analysis Report ### Issue Validity: ✅ VALID & ACTIONABLE This is a well-documented Priority/Critical UAT bug with clear specifications, acceptance criteria, and actionable subtasks. The issue is valid and ready for implementation. ### Label Compliance Check **Current Labels:** - ✅ State/Unverified (id: 846) - ✅ Type/Bug (id: 849) - ✅ Priority/Critical (id: 858) - ✅ MoSCoW/Must have (id: 883) **Status:** All required labels present (State/, Type/, Priority/). MoSCoW label is present (assumed pre-approved by AUTO-OWNR). ### Triage Assessment **Recommendation:** Move from State/Unverified → State/Verified **Rationale:** - Issue is clearly valid and actionable - Detailed specification provided (ADR-045, Persona System) - Clear acceptance criteria and subtasks - Well-scoped implementation path - No blockers or dependencies identified ### Milestone Assignment **Status:** ✅ ASSIGNED to v3.7.0 (M8: TUI Implementation) This is the correct milestone as the issue concerns the PersonaBar widget, a core TUI component. ### Priority/Critical Flag 🚨 **CRITICAL ATTENTION REQUIRED:** - This is a Priority/Critical issue currently in State/Unverified - Per CONTRIBUTING.md: Priority/Critical issues with no State/In Progress should be flagged for attention - **Recommended Action:** Once verified, assign to a developer and move to State/In Progress immediately - **No assignee currently set** — needs assignment upon verification ### Technical Summary **Problem:** PersonaBar widget renders 4 segments instead of spec-required 5 (missing session cost) **Root Cause:** - PersonaBar.set_content() in src/cleveragents/tui/widgets/persona_bar.py lacks session_cost parameter - _refresh_persona_bar() in src/cleveragents/tui/app.py does not compute/pass session cost **Solution Scope:** 1. Add session_cost: str parameter to PersonaBar.set_content() 2. Update format string to include 5th segment 3. Compute and pass session cost from _refresh_persona_bar() 4. Add/update Behave scenarios 5. Maintain coverage ≥ 97% ### Grooming Checklist - ✅ Issue validity assessed - ✅ All required labels present - ✅ Milestone assigned (v3.7.0) - ✅ Priority/Critical flagged - ⚠️ State label update pending (API restriction) - ✅ No blockers identified - ✅ Ready for assignment and implementation ### Next Steps 1. **Manual Action Required:** Update State/Unverified → State/Verified (label API restricted) 2. **Assign to Developer:** Once verified, assign to appropriate team member 3. **Move to In Progress:** Update State/Verified → State/In Progress when work begins 4. **Implementation:** Follow subtasks and acceptance criteria in issue description --- **Automated by CleverAgents Bot** Supervisor: Grooming | Agent: grooming-pool-supervisor
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#10299
No description provided.