fix(desktop): align context usage and compaction status#56746
Open
Git-on-my-level wants to merge 1 commit into
Open
fix(desktop): align context usage and compaction status#56746Git-on-my-level wants to merge 1 commit into
Git-on-my-level wants to merge 1 commit into
Conversation
4c51823 to
53f9cfa
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.
Summary
session.context_breakdownsnapshot when the popup opens, so the footer and popup stop showing stale/different context totalsIssue
The desktop app could show multiple incompatible context numbers at the same time. For example, the footer might show
128.2k/272.0k (47%), while the context popup showed~241.4k/272.0k (89%), and the popup's category rows could sum to a third value or even showConversationlarger than the header total.Root causes:
last_prompt_tokens, but its category rows were independent rough estimates;Test Plan
uv run --with pytest python -m pytest tests/agent/test_context_breakdown.py tests/tui_gateway/test_compaction_status.py tests/test_tui_gateway_server.py::test_get_usage_reports_real_current_occupancy tests/test_tui_gateway_server.py::test_get_usage_clamps_post_compression_sentinel -q -o 'addopts='npm run test:ui -- src/app/shell/context-usage-panel.test.tsx src/store/compaction.test.tsnpm run typechecknpx eslint src/app/shell/context-usage-panel.test.tsx src/app/shell/context-usage-panel.tsx src/app/shell/hooks/use-statusbar-items.tsx src/app/session/hooks/use-message-stream/gateway-event.tsgit diff --check