Reset the context meter on clear and after compaction - #550
Merged
TheGreatAxios merged 3 commits intoAug 23, 2026
Merged
Conversation
The prompt Ctx meter kept showing prior occupancy after /new and /clear, and stayed inflated after a successful fold until the next inference.done. Clear the painted meter immediately on session clear, hide it when the session has no turns, and treat the post-compact governor estimate as authoritative until real usage arrives.
Idle compaction with an empty continuation never marked the governor estimate authoritative, so the prompt meter kept pre-fold occupancy until the next user turn. Resume with a meter-only settle so the shrunk estimate paints without starting another inference.
TheGreatAxios
enabled auto-merge
August 23, 2026 21:07
…-meter-on-new-clear-and-after-compaction # Conflicts: # src/agent/compaction.test.ts # src/agent/compaction.ts
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
/newand/clearso it no longer shows prior session occupancyinference.startand on the meter-only settle path so operators see the update without a following user turnVerification
bun run typecheck,bun run build, andbun run testpass/clearafter a long session hides Ctx; after a real compact, meter drops and/or flash path from sibling PR is independentFixes CL-6933