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 <cursoragent@cursor.com>
This commit is contained in:
2026-06-18 22:57:27 +07:00
parent 20429a02ab
commit eba5b5dc99
+2
View File
@@ -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,