Repository navigation
Test that replacing old reads alone does not trigger a shake - #19
Merged
Merged
Conversation
When replacing superseded reads brings the context under the threshold but not to progressRatio of it, turn_end keeps only those edits and does not shake, so the context breaks the prompt cache once instead of twice. The test pins this and fails with the gate on Pi's raw token count.
A regression that keeps the planned tokens above the threshold would run a handoff compaction and still pass the edit-count assertion.
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.
Why
#16 changed the shake gate after a handoff from Pi's raw token count to the planned result. The #16 review noted a second case that the change affects, and no test covered it: replacing superseded reads alone brings the context under the threshold, but not to
progressRatioof it. Thenturn_endkeeps only those edits and does not shake. That is the intended behavior: one cache break instead of two, and the code blocks stay visible until the next threshold.Changed behavior
None. Test only.
Verification
e0f57ca, repository root:npm run check, 1 run, tsc and lint clean, 101 tests passed.tokens > limit), the bug fixed in Shake after handoff only when pruning is not enough #16: it finds anElided blockedit next to the superseded read. 1 run.planMaintenancereturns the raw token count after the stale edit: it finds 1 compaction entry where it expects 0. 1 run.e0f57cawith the no-compaction anddoneassertions.Risk and rollback
Low: one new test in
test/extension.test.ts. Rollback: revert the squash commit. Owner: HugoLopes45.