From eba5b5dc9913747ca5f85b2bbb9041ca5e898a9e Mon Sep 17 00:00:00 2001 From: GRayHook Date: Thu, 18 Jun 2026 22:57:27 +0700 Subject: [PATCH] Phase 15: call ensureCompactionSourceMarked on session_compact Safety net when session_before_compact does not run so auto compaction still sets lastCompactionSource and passes the reinject gate. Co-authored-by: Cursor --- src/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/index.ts b/src/index.ts index 77bd302..244fbbc 100644 --- a/src/index.ts +++ b/src/index.ts @@ -11,6 +11,7 @@ import { registerSkillReinjectCommand, updateSkillReinjectStatusLine } from "./c import { consumeCompactionOnSessionCompact, createCompactionRuntime, + ensureCompactionSourceMarked, markAutoCompactionBeforeCompact, markManualCompactionFromInput, } from "./compaction.js"; @@ -103,6 +104,7 @@ export default function skillReinject(pi: ExtensionAPI): void { const trackedNames = state.skills.map((skill) => skill.name); const keptEntries = getKeptEntries(branch, event.compactionEntry.firstKeptEntryId); const keptPresent = skillsPresentInKeptWindow(keptEntries, trackedNames); + ensureCompactionSourceMarked(compactionRuntime); const shouldReinject = consumeCompactionOnSessionCompact( compactionRuntime, state,