Repository navigation
fix(auto-handoff): trust context size only after a reply following the last compact - #57
Merged
Merged
Conversation
…e last compact A compacted session keeps logging its pre-compact context until the model replies, and local commands like /context hid the /compact from the last-prompt check, so a 29k thread read as 201k and was compacted again. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Claude review: skipped (the PR is already merged, so it is closed) |
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.
The watcher compacted a thread whose real context was ~6k. After
/compactthe session log keeps the old assistant usage (201k) until the model next replies, and the follow-up/contextmade the last-prompt check miss the compact, so the stale size passed--min-tokens.compacted_since_last_turnnow treats a session as compacted from acompact_boundaryor/compactcommand until the next assistant reply with usage. Replaceslast_prompt_is_compact.Dry run on the real logs:
31ec998dnow skips asalready compacted.🤖 Generated with Claude Code