Files
oh-my-opencode/src/hooks/todo-continuation-enforcer/compaction-guard.ts
T
conversun 088844474a 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.
2026-03-13 00:55:37 +08:00

11 lines
301 B
TypeScript

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
}