Skip to content

fix(cache-timer): reset the countdown only when the main conversation was compacted - #18

Merged
arasovic merged 2 commits into
mainfrom
fix/cache-timer-compact-reset
Oct 13, 2026
Merged

arasovic merged 2 commits into
mainfrom
fix/cache-timer-compact-reset

Conversation

@arasovic

Copy link
Copy Markdown
Owner

What changes

  • cache-timer: the countdown now clears only after the main conversation was really compacted. A subagent's compaction, a skipped compaction and a summary prepared ahead of time (precompute) leave it running. The hook waits for the compaction's result before it decides. Version 0.1.0 → 0.1.1.
  • compact-keeper: tests only. A new test checks that no handoff is written for a skipped, a precompute or a subagent compaction, and that a main-thread compaction writes one.

Why

Claude Code's idle compaction fires session.compact with trigger: 'auto', so cache-timer clears on it as intended. The old hook also cleared before next(e), so it reset on skips, precomputes and subagent compactions, which do not touch the main thread's cache.

Verification

  • claude plugin test and claude plugin validate --strict for every mod, plus the marketplace: pass.
  • ./typecheck.sh: pass.
  • Each guard removed in turn makes its test fail (cache-timer: agentId, skip, precompute; compact-keeper: skip, precompute, agentId).
  • Not checked in a live session.

… was compacted

A subagent's compaction, a skipped one and a precompute left the main
thread's cache as it was, but cleared the band. The hook now waits for
the compaction's result before it clears the countdown.
@arasovic
arasovic merged commit a30e6d7 into main Oct 13, 2026
1 check passed
@arasovic
arasovic deleted the fix/cache-timer-compact-reset branch October 13, 2026 18:29
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