fix(todo-continuation-enforcer): tighten post-compaction guard with session-agent fallback

Refine continuation agent resolution to prefer session-state agent fallback while keeping compaction-specific protection. Replace sticky boolean compaction flag with a short-lived timestamp guard so unresolved agents are blocked only during the immediate post-compaction window, avoiding long-lived suppression and preserving existing continuation behavior.
This commit is contained in:
conversun
2026-03-13 00:55:37 +08:00
parent 22b4b30dd7
commit 088844474a
7 changed files with 66 additions and 32 deletions
@@ -0,0 +1,10 @@
import { COMPACTION_GUARD_MS } from "./constants"
import type { SessionState } from "./types"
export function isCompactionGuardActive(state: SessionState, now: number): boolean {
if (!state.recentCompactionAt) {
return false
}
return now - state.recentCompactionAt < COMPACTION_GUARD_MS
}