Repository navigation
fix(compacting): close an idle compaction with done - #77
Merged
Merged
Conversation
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 (omartelo/lich#767).
Merged
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 and hands
session.compactto the mod astrigger: "auto", the same trigger as a compaction inside a turn.hooks/mod-compacting.jsclosed everyautowithbusy; with no turn open and noStopto follow, the lich card showed the session running until the next prompt.The mod now closes with the turn's state: it follows
turn.start/turn.completeand reportsbusywhile a turn is open,donewhen none is. Contract: omartelo/lich#767.The two turn hooks match
{ turnId: /^/ }: Claude Code refuses a plugin's second hook on an event with no matcher, andmod-control.jsalready holds those. A RegExp matcher firing beside an unmatched hook was checked underclaude plugin testwith a minimal plugin.Test changes: the
autocases that expectbusynow open a turn first (the contract changed: the closing state is keyed on the turn), and the fake engine tests a RegExp matcher value as the engine does.Test plan
node --test tests/*.test.mjs: 419 pass. The new idle test fails against the old mod.claude plugin test .: 32 pass (the module loads beside the other mods).$.session.compactalways fires withtrigger: "plugin", soautocannot be driven there.