From 4eb38d99d2b2c0ab02386bbebab8bd8890da06d5 Mon Sep 17 00:00:00 2001 From: YeonGyu-Kim Date: Fri, 6 Mar 2026 16:31:48 +0900 Subject: [PATCH] fix(atlas): add full eligibility checks to delayed retry callback Address Cubic P1 review: timer callback now re-checks failure backoff count, boulder session membership, and running background tasks before injecting continuation, matching the main idle handler's eligibility gate. --- src/hooks/atlas/event-handler.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/hooks/atlas/event-handler.ts b/src/hooks/atlas/event-handler.ts index 21c186131..c88062a61 100644 --- a/src/hooks/atlas/event-handler.ts +++ b/src/hooks/atlas/event-handler.ts @@ -128,14 +128,22 @@ export function createAtlasEventHandler(input: { state.pendingRetryTimer = setTimeout(async () => { state.pendingRetryTimer = undefined + if (state.promptFailureCount >= 2) return + const currentBoulder = readBoulderState(ctx.directory) if (!currentBoulder) return + if (!currentBoulder.session_ids?.includes(sessionID)) return const currentProgress = getPlanProgress(currentBoulder.active_plan) if (currentProgress.isComplete) return if (options?.isContinuationStopped?.(sessionID)) return + const hasBgTasks = backgroundManager + ? backgroundManager.getTasksByParentSession(sessionID).some((t: { status: string }) => t.status === "running") + : false + if (hasBgTasks) return + state.lastContinuationInjectedAt = Date.now() const currentRemaining = currentProgress.total - currentProgress.completed try {