Repository navigation
docs(hooks): close compacting with the turn's state, not the trigger's - #767
Merged
Merged
Conversation
Claude Code 2.1.300 compacts an idle conversation before its prompt cache expires and hands the mod that compaction as `auto`, the trigger a mid-turn one carries. Closing every `auto` with `busy` left the card on the spinner with no Stop to follow. The closing report is now the turn's state: `busy` while a turn is open, `done` when none is.
2 of 3 tasks
omartelo
added a commit
to lichdotdev/lich-plugin
that referenced
this pull request
Oct 15, 2026
Claude Code 2.1.300 compacts an idle conversation before its prompt cache expires and reports it as `auto`, the trigger of a compaction inside a turn. The mod closed every `auto` with `busy`, and with no turn open and no Stop to follow, the card sat on the spinner until the next prompt. The closing state is now the turn's: the mod follows turn.start and turn.complete and closes with `busy` while a turn is open, `done` when none is. The existing `auto` tests open a turn first, since the contract now keys the closing state on it (lichdotdev/lich#767).
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
Claude Code 2.1.300 compacts an idle conversation before its prompt cache expires ("Compacted while idle, before the prompt cache expired"). It prepares the summary under a
precomputetrigger and applies it through the same path as a mid-turn reactive compaction, sosession.compactreaches lich-plugin's mod withtrigger: "auto". The mod closed everyautowithbusy, and with no turn open there is noStopto follow: the card stayed on the spinner until the next prompt.The contract now says the closing report is the turn's state (
busywhile a turn is open,donewhen none is), and the table gains the idle row. No backend change: lich already reads adoneaftercompactingwithout raising a "has finished" notification.The client side lands in lichdotdev/lich-plugin#77.
Test plan
CHncallssession.compactwithtrigger:"auto") and seen in a real session; not measured at a PTY against a stub.