fix(atlas): block continuation while delegated tasks are pending#3771
Merged
code-yeongyu merged 1 commit intocode-yeongyu:devfrom May 4, 2026
Merged
Conversation
Atlas continuation only treated running background tasks as active work. When a delegated subagent had been launched but was still waiting for session creation, the task remained pending and Atlas could inject another continuation too early. Treat pending tasks as active background work in the continuation injector and add regression coverage for the pending-session-creation race so delegated work is allowed to acquire a session before Atlas resumes the plan. Tests: bun test src/hooks/atlas/boulder-continuation-injector.test.ts src/hooks/atlas/index.test.ts; bun run typecheck Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Auto-approved: Correctly prevents race conditions by treating 'pending' tasks as active. Simple logic change with regression tests.
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pendingbackground tasks as active when Atlas decides whether to inject a continuationRoot cause
Atlas continuation only checked for
runningbackground tasks. When a delegated subagent had already been launched but had not yet acquired its session ID, the task remained inpending. That left a race window where Atlas could inject another continuation before the delegated work had actually started, which made the orchestration appear stuck or out of order.What changed
src/hooks/atlas/boulder-continuation-injector.tsto treat bothpendingandrunningtasks as active background worksrc/hooks/atlas/boulder-continuation-injector.test.tsTests
bun test src/hooks/atlas/boulder-continuation-injector.test.ts src/hooks/atlas/index.test.tsbun run typecheckNeed help on this PR? Tag
@codesmithwith what you need.Summary by cubic
Block Atlas continuation while delegated background tasks are still pending session creation, closing a race that could resume plans too early. This keeps orchestration in order and prevents stuck-looking runs.
pendingandrunningbackground tasks as active ininjectBoulderContinuation(viaACTIVE_BACKGROUND_TASK_STATUSES).Written for commit 56e4044. Summary will update on new commits.