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.
This commit is contained in:
YeonGyu-Kim
2026-01-08 00:44:20 +09:00
parent 69a12663c4
commit 0d90bc1360

View File

@@ -385,12 +385,17 @@ export function createSisyphusOrchestratorHook(
log(`[${HOOK_NAME}] session.idle`, { sessionID })
// Read boulder state FIRST to check if this session is part of an active boulder
const boulderState = readBoulderState(ctx.directory)
const isBoulderSession = boulderState?.session_ids.includes(sessionID) ?? false
const mainSessionID = getMainSessionID()
const isMainSession = sessionID === mainSessionID
const isBackgroundTaskSession = subagentSessions.has(sessionID)
if (mainSessionID && !isMainSession && !isBackgroundTaskSession) {
log(`[${HOOK_NAME}] Skipped: not main or background task session`, { sessionID })
// Allow continuation if: main session OR background task OR boulder session
if (mainSessionID && !isMainSession && !isBackgroundTaskSession && !isBoulderSession) {
log(`[${HOOK_NAME}] Skipped: not main, background task, or boulder session`, { sessionID })
return
}
@@ -411,7 +416,7 @@ export function createSisyphusOrchestratorHook(
return
}
const boulderState = readBoulderState(ctx.directory)
if (!boulderState) {
log(`[${HOOK_NAME}] No active boulder`, { sessionID })
return