feat(atlas): add background task session tracking with retry scheduling

- Add background-launch-session-tracking.ts to persist delegated sessions
- Add task-context.ts for task context resolution utilities
- Modify idle-event.ts to schedule retries when background tasks are running
- Update tool-execute-after.ts to integrate session tracking
- Add comprehensive tests for background task retry behavior

🤖 Generated with assistance of OhMyOpenCode
This commit is contained in:
YeonGyu-Kim
2026-04-05 14:59:03 +09:00
parent 90407a9789
commit ccfc54ab38
6 changed files with 454 additions and 53 deletions
+5 -1
View File
@@ -90,7 +90,10 @@ function scheduleRetry(input: {
const currentProgress = getPlanProgress(currentBoulder.active_plan)
if (currentProgress.isComplete) return
if (options?.isContinuationStopped?.(sessionID)) return
if (hasRunningBackgroundTasks(sessionID, options)) return
if (hasRunningBackgroundTasks(sessionID, options)) {
scheduleRetry({ ctx, sessionID, sessionState, options })
return
}
await injectContinuation({
ctx,
@@ -194,6 +197,7 @@ export async function handleAtlasSessionIdle(input: {
}
if (hasRunningBackgroundTasks(sessionID, options)) {
scheduleRetry({ ctx, sessionID, sessionState, options })
log(`[${HOOK_NAME}] Skipped: background tasks running`, { sessionID })
return
}