Skip to content

feat(opencode): display cached token count inline in TUI#23111

Open
bainos wants to merge 2 commits intoanomalyco:devfrom
bainos:feat/tui-cache-display
Open

feat(opencode): display cached token count inline in TUI#23111
bainos wants to merge 2 commits intoanomalyco:devfrom
bainos:feat/tui-cache-display

Conversation

@bainos
Copy link
Copy Markdown
Contributor

@bainos bainos commented Apr 17, 2026

Issue for this PR

Closes #23109

Type of change

  • New feature

What does this PR do?

Shows `(N cached)` inline next to the token count in the sidebar context panel, prompt footer, and subagent footer when `cache.read + cache.write > 0`. No change when zero.

How did you verify your code works?

Tested locally with Bedrock Sonnet 4.6. See screenshot below.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@bainos
Copy link
Copy Markdown
Contributor Author

bainos commented Apr 17, 2026

image image

@bainos bainos force-pushed the feat/tui-cache-display branch 2 times, most recently from 3c3107e to d686247 Compare April 29, 2026 12:26
rekram1-node and others added 2 commits April 30, 2026 16:54
Shows cache tokens inline when non-zero:
- Sidebar context: "68,356 tokens (12.5K cached)"
- Subagent footer: same format with percentage
- Prompt footer: same format with percentage

Implementation:
- Extract cached tokens separately before summing
- Show only when cached > 0 to reduce noise
- Use existing Locale.number() for consistent formatting
- Applied to all 3 TUI locations that display token usage
@bainos bainos force-pushed the feat/tui-cache-display branch from d686247 to 94ddc20 Compare April 30, 2026 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE]: Show cached token count inline in TUI context panels

2 participants