Skip to content

Commit 0d90bc1

Browse files
committed
fix(sisyphus-orchestrator): check boulder session_ids before filtering sessions
Bug: continuation was not triggered even when boulder.json existed with session_ids because the session filter ran BEFORE reading boulder state. Fix: Read boulder state first, then include boulder sessions in the allowed sessions for continuation.
1 parent 69a1266 commit 0d90bc1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/hooks/sisyphus-orchestrator/index.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -385,12 +385,17 @@ export function createSisyphusOrchestratorHook(
385385

386386
log(`[${HOOK_NAME}] session.idle`, { sessionID })
387387

388+
// Read boulder state FIRST to check if this session is part of an active boulder
389+
const boulderState = readBoulderState(ctx.directory)
390+
const isBoulderSession = boulderState?.session_ids.includes(sessionID) ?? false
391+
388392
const mainSessionID = getMainSessionID()
389393
const isMainSession = sessionID === mainSessionID
390394
const isBackgroundTaskSession = subagentSessions.has(sessionID)
391395

392-
if (mainSessionID && !isMainSession && !isBackgroundTaskSession) {
393-
log(`[${HOOK_NAME}] Skipped: not main or background task session`, { sessionID })
396+
// Allow continuation if: main session OR background task OR boulder session
397+
if (mainSessionID && !isMainSession && !isBackgroundTaskSession && !isBoulderSession) {
398+
log(`[${HOOK_NAME}] Skipped: not main, background task, or boulder session`, { sessionID })
394399
return
395400
}
396401

@@ -411,7 +416,7 @@ export function createSisyphusOrchestratorHook(
411416
return
412417
}
413418

414-
const boulderState = readBoulderState(ctx.directory)
419+
415420
if (!boulderState) {
416421
log(`[${HOOK_NAME}] No active boulder`, { sessionID })
417422
return

0 commit comments

Comments
 (0)