fix: status bar accumulation and percentage display#19
Merged
tuanhung303 merged 2 commits intomasterfrom Feb 8, 2026
Merged
Conversation
- Add MODEL_CONTEXT_WINDOWS map with known model context sizes (Claude, GPT, Gemini, DeepSeek) - Compute context pressure per turn: rawWindow × 70% threshold, status labels (🟢🟡🟠🔴) - Add contextPressure to SessionState (transient, recomputed each turn) - Status bar: replace ₊ with | separator, show status emoji + percent (e.g. 🟡 59%) - Reasoning notifications: show 🧠 (xN) instead of 🧠 "—" for thinking blocks - Reminder checkpoint: show model info, remaining tokens, savings from pruning - Replace static maxContextTokens with fallbackContextWindow + warningThresholdPercent - Remove outputBufferPercent — use raw context window directly
- Add shared sumAutoSupersede/sumToolPruneStats utilities (lib/state/stats-utils.ts) - Include all 8 autoSupersede categories + purgeErrors in status bar totals - Fix sendAttemptedNotification bypassing formatStatsHeader on no-op paths - Replace duplicated summation in /acp stats with shared utility - Data-driven breakdown loop for all auto-supersede sub-categories Fixes: status not accumulating (5 categories missing), percentage intermittently absent (no-op notification path skipped stats header)
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
sendAttemptedNotification()bypassedformatStatsHeader()sumAutoSupersede()/sumToolPruneStats()utilities to prevent future drift between status bar and/acp statsChanges
lib/state/stats-utils.ts(new)sumAutoSupersede()(dynamic viaObject.valueswith type guards),sumToolPruneStats()lib/state/index.tsstats-utilslib/ui/utils.tsformatStatsHeader()usessumToolPruneStats()— all 8 autoSupersede + purgeErrorslib/commands/stats.ts/acp statsusessumAutoSupersede()+ data-driven breakdown for all 8 categorieslib/ui/notification.tssendAttemptedNotification()prependsformatStatsHeader(state)with null-guardTesting