Phase 15: add ensureCompactionSourceMarked for compaction source fallback
Extract shared helper so session_before_compact and session_compact can both infer auto when compaction was not explicitly manual. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+7
-2
@@ -25,13 +25,18 @@ export function markManualCompactionFromInput(text: string, runtime: CompactionR
|
||||
}
|
||||
}
|
||||
|
||||
/** session_before_compact: default to auto unless input already marked manual (SPEC §8). */
|
||||
export function markAutoCompactionBeforeCompact(runtime: CompactionRuntime): void {
|
||||
/** If not explicitly manual, mark compaction source as auto (SPEC §8). */
|
||||
export function ensureCompactionSourceMarked(runtime: CompactionRuntime): void {
|
||||
if (runtime.pendingCompactionSource !== "manual") {
|
||||
runtime.pendingCompactionSource = "auto";
|
||||
}
|
||||
}
|
||||
|
||||
/** session_before_compact: default to auto unless input already marked manual (SPEC §8). */
|
||||
export function markAutoCompactionBeforeCompact(runtime: CompactionRuntime): void {
|
||||
ensureCompactionSourceMarked(runtime);
|
||||
}
|
||||
|
||||
/** Gate re-inject on session_compact from enabled layer and compaction source (SPEC §8). */
|
||||
export function shouldReinjectAfterCompaction(
|
||||
sessionOverride: boolean | null,
|
||||
|
||||
Reference in New Issue
Block a user