You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Sep 23, 2026. It is now read-only.
Subagent context usage is not tracked or visible in parent agent statistics #2024
Currently, subagent context/token usage is completely isolated from the parent agent'''s statistics. This leads to:
Invisible subagent context consumption: The parent agent'''s status bar shows only its own context usage, giving users no visibility into how much context their subagents are consuming.
No compaction trigger for subagents: Auto-compaction only considers the parent context, so subagents can grow unbounded without triggering compaction.
No inspection mechanism: There is no command, API, or UI feature to check a subagent'''s current token count or context usage percentage.
Current Behavior
Each subagent gets its own Context instance with a separate context.jsonl file (src/kimi_cli/subagents/core.py:59)
Each subagent gets its own KimiSoul instance (src/kimi_cli/subagents/core.py:85)
StatusUpdate wire messages only contain the current soul'''s context metrics (src/kimi_cli/soul/kimisoul.py:951-961)
The UI status bar (src/kimi_cli/ui/shell/prompt.py) only renders the parent soul'''s StatusSnapshot
The Vis API /subagents endpoint only returns raw file sizes (bytes), not token counts
Expected Behavior
Users should be able to:
See subagent context usage aggregated in the parent agent'''s status, OR
Have a way to inspect individual subagent context usage (e.g., a slash command or API endpoint)
Possible Solutions
Aggregate in parent status: Sum active subagents''' token_count into the parent'''s StatusSnapshot.context_usage
Expose subagent stats: Add token_count/context_usage fields to AgentInstanceRecord and expose via Vis API
New slash command: Add /subagents command to list running subagents with their context usage
Event propagation: Forward subagent StatusUpdate events to the parent wire stream
Additional Context
The Context class already tracks _token_count internally, so the data exists — it'''s just never read or exposed for subagents.
Activity