Skip to content

feat(tui): per-sub-agent context accounting in the TUI #3438

Description

@aheritier

Summary

Surface each agent / sub-session's context usage (% of window) in the TUI. This is a multi-agent differentiator — no competitor exposes per-sub-agent context accounting.

Motivation

The plumbing already exists: TokenUsageEvent carries per-session/per-agent usage incl. ContextLimit, and the sidebar tracks a sessionUsage map. It just isn't surfaced per agent.

Proposed behavior

  • Show per-agent / per-sub-session context % in the sidebar agent list and in the agent-details dialog.
  • Include background agents (pkg/tools/builtin/agent).

Implementation notes (starting points)

  • pkg/tui/components/sidebar/sidebar.go (+ layout.go)
  • pkg/tui/dialog/agent_details.go

Complexity: M.

Background: shared plan context-management-gap-analysis (Phase 3, item 7).

Dependencies / Relationships

Metadata

Metadata

Assignees

Labels

area/agentFor work that has to do with the general agent loop/agentic features of the apparea/tuiFor features/issues/fixes related to the TUIkind/featPR adds a new feature (maps to feat:). Use on PRs only.

Fields

No fields configured for Enhancement.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions