feat(web): context window popout gets a breakdown bar and cached input rate - #171
Merged
Merged
Conversation
…t rate The composer's context window card now shows a stacked bar of what fills the window, with a collapsible largest-first legend. Claude sessions get the real per-category breakdown from the SDK's context usage report (deferred tool categories are excluded since they are not part of the used total); Codex shows a single used-vs-free segment. Both providers get a cached-input rate line derived from session input totals, with the Codex adapter's cumulative fields now sourced from session-wide totals instead of the last turn. A category-less context report from a freshly resumed Claude process is ignored so it cannot replace the last rich snapshot with a bare one, and all displayed numbers truncate at their shown precision instead of rounding, so 96,632 reads 96.6k (never 97k) and a 99.97% cache rate reads 99.9% (never 100%).
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
…er rounds up Merging main brought the agents panel width test, which the one-decimal token format broke: 'model · effort · 48.1k tokens' overflowed the 330px meta line by 3px. Meta lines now use a compact variant that drops the k-range decimal but still truncates (48,999 reads 48k, never 49k); the context window popout keeps full one-decimal precision.
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.
The context window card only showed a single used-percentage number, even though Claude reports a full breakdown of what fills the window and both providers report cache statistics we were discarding.
The popout now renders a stacked bar with a collapsible largest-first legend (free space always last). Claude threads get the real per-category breakdown from the SDK's context usage report; deferred tool categories are filtered out server-side since they are excluded from the used total and made the rows sum past the header. Codex has no composition data, so it renders a single used-vs-free segment through the same path. Both providers get a cached-input rate row, backed by the Codex adapter now sourcing its cumulative token fields from session-wide totals instead of the last turn (nothing rendered those fields before).
Two robustness rules came out of live testing: a category-less context report from a freshly resumed Claude process is ignored, so it cannot replace the last rich snapshot with a bare one until real data arrives, and every displayed number truncates at its shown precision instead of rounding (96,632 reads 96.6k, never 97k; a 99.97% cache rate reads 99.9%, never 100%).
Adds eight categorical color tokens in light and dark. Layout verified down to 320px in both themes.