Live context gauge below the input box + honest busy-line token count#10
Merged
Conversation
The busy status line showed CUMULATIVE input+output across requests — input re-bills the whole history every request, so the figure ballooned quadratically and read like context usage when it was billed traffic. - Busy line now shows 'ctx 84.2k' — the LAST request's real prompt size (uncached + cache-read + cache-write), i.e. what the model holds. - New bottom-right gauge under the input box, both idle and busy: 'context 84.2k / 1.00m (8%)' — live size vs the model's window from the registry (re-resolved at turn start so /model switches track). - Updates from real usage events; resumes seed from the estimate; compaction snaps it to the post-compact size. - Cumulative billed total remains available in /status and /lens where it's labeled correctly. Live-verified in tmux against the mock (149/200k after one turn — 99 uncached + 40 read + 10 written). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Summary
The busy status line accumulated
input + outputacross requests — and since every request re-bills the whole history as input, the figure ballooned quadratically and read like context usage when it was actually cumulative billed traffic.context 84.2k / 1.00m (8%)— the last request's real prompt size (uncached + cache-read + cache-write, i.e. what the model actually holds) vs the model's window from the registry. The ceiling re-resolves at turn start so mid-session/modelswitches track; resumes seed from the estimate; compaction snaps it to the post-compact size.ctx 84.2k— live context growth per request — instead of the misleading cumulative figure./statusand/lens, labeled as what they are.Test plan
cd ts && bun test— 124 tests, 0 failcontext 149 / 200.0k (0%)after one turn (99 uncached + 40 cache-read + 10 cache-write)🤖 Generated with Claude Code