anomalyco / anomalyco/opencode
tui: sidebar missing when viewing a subagent session — no context usage or cost for that session
@simonklee is already working on this.
Since Sep 11, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
When navigating into a subagent (child) session in the opencode2 TUI, the session sidebar is not rendered. Since the Context section lives in the sidebar, there is no way to see the subagent session's own context usage (tokens / percentage) or cost while viewing it. The sidebar only appears for the root session.
Reproduction
- In opencode2, run a prompt that spawns a subagent (e.g. the task tool).
- Navigate into the child session:
down(session.child.first) to open the subagent picker, orright(session.child.next) to go to the next child session. - Observe that the sidebar is missing while viewing the subagent session.
session.sidebar.toggle(<leader>b) does not bring it back in the child session.
Expected Behavior
The sidebar should be available in subagent session views as well, with the Context section showing that session's token usage and cost.
Actual Behavior
The sidebar is absent for child/subagent sessions, so context usage and cost for that specific session cannot be inspected anywhere in the TUI.
Impact
For subagent-heavy workflows, per-subagent context pressure and spend are invisible in the TUI. The parent session's sidebar does not compensate for this (see also #45417 for subagent cost not being aggregated).
Environment
- opencode2 v0.0.0-beta-19425
- Linux x86_64
- npm install (
@opencode/cli)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.