UAT: PersonaBar missing session cost segment — spec requires 5 segments including cost display #4047

Open
opened 2026-04-06 09:23:14 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/tui-persona-bar-missing-cost-segment
  • Commit Message: fix(tui): add session cost segment to PersonaBar
  • Milestone: (none — backlog)
  • Parent Epic: #868

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 Report

What Was Tested

Code-level analysis of src/cleveragents/tui/widgets/persona_bar.py and src/cleveragents/tui/app.py — specifically the PersonaBar.set_content() method and how it is called from _refresh_persona_bar().

Expected Behavior (from spec)

The specification (PersonaBar section, line ~29109–29128) defines the PersonaBar as having 5 segments:

feature-dev │ claude-4-sonnet │ think: high │ 2 projects │ $0.12
─────────── ─ ─────────────── ─ ─────────── ─ ──────────────── ─ ─────
persona       actor             preset        scope              cost

The spec table:

PersonaBar Segment Style Updates When
Persona name $text-primary on $primary 10% bg tab cycle
Actor name $text-secondary tab cycle
Preset label $text-warning (non-default) / $text-muted (default) ctrl+tab cycle
Scope indicator $text-muted Persona change or /scope:add/remove
Session cost $secondary 70%, right-aligned After each actor response

Actual Behavior

The PersonaBar.set_content() method in src/cleveragents/tui/widgets/persona_bar.py only accepts and displays 4 segments — it has no cost parameter:

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 _refresh_persona_bar() method in app.py also does not pass a cost value:

def _refresh_persona_bar(self) -> None:
    persona = self._persona_state.active_persona(self._session.session_id)
    preset = self._persona_state.current_preset(self._session.session_id)
    scope_count = len(persona.scoped_projects) + len(persona.scoped_plans)
    scope_text = f"{scope_count} scope refs"
    bar = self.query_one("#persona-bar", PersonaBar)
    bar.set_content(
        persona_name=persona.name,
        actor_name=persona.actor,
        preset_name=preset,
        scope_text=scope_text,
    )

The session cost ($0.12) is never displayed in the PersonaBar.

Code Location

  • src/cleveragents/tui/widgets/persona_bar.pyPersonaBar.set_content() method
  • src/cleveragents/tui/app.py_refresh_persona_bar() method

Subtasks

  • Add cost_text: str parameter to PersonaBar.set_content() with a default of "$0.00"
  • Update the update() call to include the cost segment: f"{persona_name} | {actor_name} | {preset_name} | {scope_text} | {cost_text}"
  • Add session cost tracking to SessionView dataclass in app.py (e.g., session_cost: float = 0.0)
  • Pass cost to _refresh_persona_bar() and format it as f"${session_cost:.2f}"
  • Update BDD scenarios in features/tui_app_coverage.feature to assert cost is shown in persona bar
  • Verify with nox -e unit_tests

Definition of Done

  • PersonaBar displays all 5 segments: persona name, actor, preset, scope, and cost
  • Cost defaults to $0.00 on session start
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/tui-persona-bar-missing-cost-segment` - **Commit Message**: `fix(tui): add session cost segment to PersonaBar` - **Milestone**: *(none — backlog)* - **Parent Epic**: #868 > **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 Report ### What Was Tested Code-level analysis of `src/cleveragents/tui/widgets/persona_bar.py` and `src/cleveragents/tui/app.py` — specifically the `PersonaBar.set_content()` method and how it is called from `_refresh_persona_bar()`. ### Expected Behavior (from spec) The specification (PersonaBar section, line ~29109–29128) defines the PersonaBar as having **5 segments**: ``` feature-dev │ claude-4-sonnet │ think: high │ 2 projects │ $0.12 ─────────── ─ ─────────────── ─ ─────────── ─ ──────────────── ─ ───── persona actor preset scope cost ``` The spec table: | PersonaBar Segment | Style | Updates When | |--------------------|-------|--------------| | Persona name | `$text-primary` on `$primary 10%` bg | `tab` cycle | | Actor name | `$text-secondary` | `tab` cycle | | Preset label | `$text-warning` (non-default) / `$text-muted` (default) | `ctrl+tab` cycle | | Scope indicator | `$text-muted` | Persona change or `/scope:add/remove` | | **Session cost** | `$secondary 70%`, right-aligned | **After each actor response** | ### Actual Behavior The `PersonaBar.set_content()` method in `src/cleveragents/tui/widgets/persona_bar.py` only accepts and displays **4 segments** — it has no `cost` parameter: ```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 `_refresh_persona_bar()` method in `app.py` also does not pass a cost value: ```python def _refresh_persona_bar(self) -> None: persona = self._persona_state.active_persona(self._session.session_id) preset = self._persona_state.current_preset(self._session.session_id) scope_count = len(persona.scoped_projects) + len(persona.scoped_plans) scope_text = f"{scope_count} scope refs" bar = self.query_one("#persona-bar", PersonaBar) bar.set_content( persona_name=persona.name, actor_name=persona.actor, preset_name=preset, scope_text=scope_text, ) ``` The session cost (`$0.12`) is never displayed in the PersonaBar. ### Code Location - `src/cleveragents/tui/widgets/persona_bar.py` — `PersonaBar.set_content()` method - `src/cleveragents/tui/app.py` — `_refresh_persona_bar()` method ## Subtasks - [ ] Add `cost_text: str` parameter to `PersonaBar.set_content()` with a default of `"$0.00"` - [ ] Update the `update()` call to include the cost segment: `f"{persona_name} | {actor_name} | {preset_name} | {scope_text} | {cost_text}"` - [ ] Add session cost tracking to `SessionView` dataclass in `app.py` (e.g., `session_cost: float = 0.0`) - [ ] Pass cost to `_refresh_persona_bar()` and format it as `f"${session_cost:.2f}"` - [ ] Update BDD scenarios in `features/tui_app_coverage.feature` to assert cost is shown in persona bar - [ ] Verify with `nox -e unit_tests` ## Definition of Done - [ ] PersonaBar displays all 5 segments: persona name, actor, preset, scope, and cost - [ ] Cost defaults to `$0.00` on session start - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:11:34 +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.

Blocks
Reference
cleveragents/cleveragents-core#4047
No description provided.