Skip to content

feat(tui): show usage details per agent#3714

Merged
Sayt-0 merged 2 commits into
mainfrom
feat/tui-agent-usage
Jul 17, 2026
Merged

feat(tui): show usage details per agent#3714
Sayt-0 merged 2 commits into
mainfrom
feat/tui-agent-usage

Conversation

@Sayt-0

@Sayt-0 Sayt-0 commented Jul 17, 2026

Copy link
Copy Markdown
Member

Summary

  • add a Sidebar info mode selector to /settings, with the existing compact roster as the default and a detailed per-agent view as an opt-in
  • keep the compact mode identical to the current two-line agent roster
  • retain the full six-cell effort gauge while explicitly labeling effort, context, and cost in detailed mode
  • aggregate cumulative cost per agent without counting repeated session snapshots twice
  • restore historical per-agent costs from persisted session trees
  • add per-agent cost to the Agent Inspector and a By Agent section to /cost

Settings

/settingsAppearance now includes:

Sidebar info mode                         ‹ Compact ›
Mode Behavior
Compact Default. Preserves the existing two-line agent roster with effort badge and context percentage.
Detailed Shows responsive agent cards with labeled Effort, Context, and Cost metrics.

The selection previews immediately across tabs. Apply persists it as settings.layout.sidebar_info_mode: detailed; Cancel restores the previous mode. Compact is omitted from the config because it is the default.

Preview

The previews below use ANSI-stripped output.

Compact mode, default sidebar width

Agents ────────────────────────────────

▶ root                        ▰▰▰▰▱▱ ^1
  anthropic/claude-opus-4-8         30%

  helper                      ▱▱▱▱▱▱ ^2
  openai/gpt-5.4-mini               91%

  budget                      ◉ 8.2K ^3
  openai/gpt-4o

  plain                              ^4
  google/gemini-flash

Detailed mode, default sidebar width

Agents ────────────────────────────────

▶ root                               ^1
  anthropic/claude-opus-4-8
  Effort ▰▰▰▰▱▱ high
  Context 30% · Cost $0.13

  helper                             ^2
  openai/gpt-5.4-mini
  Effort ▱▱▱▱▱▱ off
  Context 91% · Cost $0.02

  budget                             ^3
  openai/gpt-4o
  Effort ◉ 8.2K · Context — · Cost —

  plain                              ^4
  google/gemini-flash
  Context — · Cost —

Detailed mode, minimum sidebar width

At the 20-column minimum width, the complete effort gauge remains visible and metrics flow onto separate lines.

Agents ────────────

▶ root           ^1
  …/claude-opus-4-8
  Effort ▰▰▰▰▱▱
  Ctx 30%
  Cost $0.13

  helper         ^2
  …nai/gpt-5.4-mini
  Effort ▱▱▱▱▱▱ off
  Ctx 91%
  Cost $0.02

  budget         ^3
  openai/gpt-4o
  Effort ◉ 8.2K
  Ctx — · Cost —

  plain          ^4
  …gle/gemini-flash
  Ctx — · Cost —

At wider sidebar sizes, all three detailed metrics share one line:

▶ root                                             ^1
  anthropic/claude-opus-4-8
  Effort ▰▰▰▰▱▱ high · Context 30% · Cost $0.13

Behavior

Area Behavior
Default UX Compact mode preserves the current roster and vertical density
Effort Detailed mode keeps the full six-cell gauge and its readable value when space permits
Context Detailed mode uses an explicit label and preserves warning and critical coloring
Cost Aggregates the latest cumulative snapshot of each distinct session
Unknown values Uses , distinct from an agent that ran at $0.00
Sub-cent costs Uses four decimals below one cent
Restored sessions Reconstructs historical per-agent costs from persisted messages and nested sub-sessions
Agent Inspector Displays the agent's context and cumulative attributed cost in both sidebar modes
/cost Adds By Agent before By Model, with separate unattributed and compaction buckets
Collapsed sidebar Unchanged by the info mode setting

Validation

Check Result
task build pass
task test pass
task lint pass
Focused race tests pass
Adversarial review pass, no blockers

Proxy variables were unset for the full test and lint runs because the local proxy intercepted private-address SSRF tests and Go module downloads.

Known limitations

  • live cost attribution after an in-session handoff follows the latest agent because cumulative session events do not expose an exact per-agent split
  • historical per-agent costs cannot be reconstructed for remote sessions that do not persist per-message attribution

@Sayt-0
Sayt-0 requested a review from a team as a code owner July 17, 2026 09:59
@dgageot
dgageot marked this pull request as draft July 17, 2026 10:01
@aheritier aheritier added area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only. labels Jul 17, 2026
@Sayt-0
Sayt-0 marked this pull request as ready for review July 17, 2026 14:22
@Sayt-0
Sayt-0 merged commit 056e7ad into main Jul 17, 2026
13 checks passed
@Sayt-0
Sayt-0 deleted the feat/tui-agent-usage branch July 17, 2026 14:22
aheritier added a commit that referenced this pull request Jul 18, 2026
aheritier added a commit that referenced this pull request Jul 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/tui For features/issues/fixes related to the TUI kind/feat PR adds a new feature (maps to feat:). Use on PRs only.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants