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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user