Skip to content

docs(hooks): close compacting with the turn's state, not the trigger's - #767

Merged
omartelo merged 1 commit into
mainfrom
docs/idle-compaction-closes-done
Oct 15, 2026
Merged

omartelo merged 1 commit into
mainfrom
docs/idle-compaction-closes-done

Conversation

@omartelo

@omartelo omartelo commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

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 precompute trigger and applies it through the same path as a mid-turn reactive compaction, so session.compact reaches lich-plugin's mod with trigger: "auto". The mod closed every auto with busy, and with no turn open there is no Stop to follow: the card stayed on the spinner until the next prompt.

The contract now says the closing report is the turn's state (busy while a turn is open, done when none is), and the table gains the idle row. No backend change: lich already reads a done after compacting without raising a "has finished" notification.

The client side lands in lichdotdev/lich-plugin#77.

Test plan

  • Docs only. The idle trigger was read off the 2.1.300 binary (CHn calls session.compact with trigger:"auto") and seen in a real session; not measured at a PTY against a stub.

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.
@omartelo
omartelo merged commit ebe0408 into main Oct 15, 2026
7 checks passed
@omartelo
omartelo deleted the docs/idle-compaction-closes-done branch October 15, 2026 14:47
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).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant