fix(atlas): await injectBoulderContinuation and handle errors

The async call was fire-and-forget with no error handling. Now properly
awaited with try/catch that logs failures and increments promptFailureCount.
This commit is contained in:
YeonGyu-Kim 2026-02-11 00:45:10 +09:00
parent f727aab892
commit fba916db60

View File

@ -122,16 +122,21 @@ export function createAtlasEventHandler(input: {
state.lastContinuationInjectedAt = now
const remaining = progress.total - progress.completed
injectBoulderContinuation({
ctx,
sessionID,
planName: boulderState.plan_name,
remaining,
total: progress.total,
agent: boulderState.agent,
backgroundManager,
sessionState: state,
})
try {
await injectBoulderContinuation({
ctx,
sessionID,
planName: boulderState.plan_name,
remaining,
total: progress.total,
agent: boulderState.agent,
backgroundManager,
sessionState: state,
})
} catch (err) {
log(`[${HOOK_NAME}] Failed to inject boulder continuation`, { sessionID, error: err })
state.promptFailureCount++
}
return
}