fix(todo-continuation-enforcer): check isContinuationStopped in injectContinuation to close race window
When /stop-continuation is invoked during the 2s countdown, the stop flag was never checked inside injectContinuation, so the injection would still fire after the countdown elapsed. Propagate isContinuationStopped from handleSessionIdle through startCountdown into injectContinuation, where it is now re-checked before any API call.
This commit is contained in:
@@ -38,6 +38,7 @@ export function startCountdown(args: {
|
||||
backgroundManager?: BackgroundManager
|
||||
skipAgents: string[]
|
||||
sessionStateStore: SessionStateStore
|
||||
isContinuationStopped?: (sessionID: string) => boolean
|
||||
}): void {
|
||||
const {
|
||||
ctx,
|
||||
@@ -47,6 +48,7 @@ export function startCountdown(args: {
|
||||
backgroundManager,
|
||||
skipAgents,
|
||||
sessionStateStore,
|
||||
isContinuationStopped,
|
||||
} = args
|
||||
|
||||
const state = sessionStateStore.getState(sessionID)
|
||||
@@ -72,6 +74,7 @@ export function startCountdown(args: {
|
||||
skipAgents,
|
||||
resolvedInfo,
|
||||
sessionStateStore,
|
||||
isContinuationStopped,
|
||||
})
|
||||
}, COUNTDOWN_SECONDS * 1000)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user