Feature: show how full each agent's context window is - #79
Merged
Merged
Conversation
The strip under the input box now shows how full the agent's context window is, left of the git chip: a bar against the configured context length for local models, and the token count alone for cloud models, which manage their window server-side. "Used" is the last request's prompt tokens. A full window adds a warning glyph, so the state never rests on color alone, and the tooltip points at /compact. The fill takes the level's theme color (green, gold, red), lifted per theme until it clears WCAG's 3:1 non-text floor against both the page and the empty track. Measured across all 25 themes, the raw colors missed 3:1 against the page in W98 - Y2K and Solarized Light, and a dim-colored track sat within 1.0-1.5:1 of the fill in most themes. A test sweeps every theme and level. The git chip now hides its own panel, and the strip shows when either part has something to show. Depends on the engine's ContextMeter (DevMando/MandoCode feature/cli-live-ui); the submodule points at that branch until it merges. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The percentage now stands on its own in the fill color, semibold, instead of "(54%)" after the token counts. Because it is text in that color, the fill is lifted to the 4.5:1 text floor against the page (from the 3:1 non-text floor), and the bar and the percentage share the one color. The theme sweep asserts the new floor in every theme and level. The meter also gets an accessible name for screen readers. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
"Context" now names the bar, which alone could read as any progress, and the counts read "13k of 32k tokens" instead of "13k / 32k". Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
One phrase, led by the colored percentage. The used count is 41% of the window, and the exact figure stays in the tooltip and accessible name. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The engine branch was rebased onto its changelog entry, so the commit recorded earlier is no longer on any branch. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…xt-bar # Conflicts: # MandoCode
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
Each tab now shows how full its agent's context window is, in the strip under the message box:
The bar and the percentage turn from green to yellow to red as the window fills. That's the cue to run
/compactbefore the model starts losing the earlier part of the conversation, which small local models do quickly.What changed
~17k tokens in context), without a bar./compact. Screen readers announce it as "Context window 41 percent full, 13k of 32k tokens".Why this was done
The only context signal Desktop had was the per-reply summary line (
[~27k in, 611 out]) and a session-wide total in the header. Neither says how close the agent is to running out of room. The CLI gained the same meter in DevMando/MandoCode#101, and this brings Desktop in line.How it was tested
Notes
ContextMeter, already on the pinned engine commit; this PR doesn't move the pin.[Unreleased]→ Added.