Skip to content

Add Agents tab for per-agent token tracking#9

Open
BubbleBuffer wants to merge 1 commit into
Cateds:masterfrom
BubbleBuffer:agents-page
Open

Add Agents tab for per-agent token tracking#9
BubbleBuffer wants to merge 1 commit into
Cateds:masterfrom
BubbleBuffer:agents-page

Conversation

@BubbleBuffer
Copy link
Copy Markdown

Adds a new Agents page that breaks down token usage by agent (the agent field from OpenCode usage events). Previously the tool only had Overview, Models, and Providers pages.

What's new

  • Agents tab in the TUI header (navigate with Tab / Left / Right arrows)
  • Per-agent chart showing token distribution across agents
  • Agent list with keyboard navigation (j/k) and fuzzy search (f)
  • Detail panel for focused agent: cost, sessions, tokens, messages, input→output, cache, rate (p50 OPS)
  • Model sub-breakdown per agent: which models each agent used with tokens, sessions, and cost
  • Share card summary includes agent info

Files changed

File Change
src/analytics/agent_stats.rs NewAgentUsageRow, AgentModelBreakdown, build_agent_chart(). Groups events by agent, builds per-model sub-breakdowns
src/ui/agents.rs Newrender_agents() TUI page with chart, list, detail panel, model sub-breakdown, search
src/analytics/model_stats.rs Made UsageAccumulator, build_chart_for_models, median public
src/ui/models.rs Made SearchItem, render_search_overlay, layout_rows public
src/analytics/mod.rs Added agent_stats module, agents + agent_chart fields
src/ui/mod.rs Added agents module
src/ui/app.rs Wired Agents page into tab navigation, search, and share card

Verification

  • cargo build: 0 warnings
  • cargo test: 39/39 passed
  • cargo fmt: clean

Adds a new Agents tab showing token usage broken down by agent (e.g. superpawers-implementer, build, explore). Includes per-agent charts, detail panels with cost/tokens/sessions/rate, and per-model sub-breakdowns within each agent. Fuzzy search and keyboard navigation supported.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant