feat(opencode): display cached token count inline in TUI#23111
Open
bainos wants to merge 2 commits intoanomalyco:devfrom
Open
feat(opencode): display cached token count inline in TUI#23111bainos wants to merge 2 commits intoanomalyco:devfrom
bainos wants to merge 2 commits intoanomalyco:devfrom
Conversation
Contributor
Author
3c3107e to
d686247
Compare
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
d686247 to
94ddc20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Issue for this PR
Closes #23109
Type of change
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