Phase 12: recalculate pending on each compact — SPEC §16.6.
Every session_compact replans pendingReinject in defer mode; skipped reinject clears the queue unless manual compaction is waiting for the next user prompt. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -96,6 +96,25 @@ export function enqueueDeferredReinjectFromCompact(
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update pending queue after session_compact; each compact recalculates or clears (SPEC §16.6).
|
||||
* Manual compaction with default settings keeps stale pending until the next user prompt.
|
||||
*/
|
||||
export function applyPendingReinjectAfterCompact(
|
||||
state: ExtensionState,
|
||||
compactionRuntime: CompactionRuntime,
|
||||
shouldReinject: boolean,
|
||||
planned: readonly string[],
|
||||
): void {
|
||||
if (shouldReinject) {
|
||||
state.pendingReinject = [...planned];
|
||||
return;
|
||||
}
|
||||
if (!compactionRuntime.clearPendingReinjectOnNextUserInput) {
|
||||
state.pendingReinject = [];
|
||||
}
|
||||
}
|
||||
|
||||
/** Warn when re-injecting many skills; unlimited by default with soft warn above 3 (SPEC §15). */
|
||||
export function maybeWarnManySkills(
|
||||
skillCount: number,
|
||||
|
||||
Reference in New Issue
Block a user