fix(agents): prevent orchestrator from rushing ahead of background agents#2328
Merged
code-yeongyu merged 2 commits intocode-yeongyu:devfrom Mar 9, 2026
Conversation
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: Prompt adjustments tighten orchestration logic to prevent race conditions and duplicate work, with verified test results across multiple models.
Contributor
|
All contributors have signed the CLA. Thank you! ✅ |
Contributor
Author
|
I have read the CLA Document and I hereby sign the CLA |
45f54d1 to
62abecd
Compare
|
Hopefully this fix would help with the subagents in general, ie rushing sisyphus-junior subagents |
4 tasks
…ents Tighten Background Result Collection instructions so the model waits for explore/librarian results instead of duplicating their work and delivering premature answers. - Remove 'Continue working immediately' which models interpreted as 'do ALL work yourself, ignore agents' - Clarify step 2: only do DIFFERENT independent work while waiting - Add explicit step 3: end response when no other work remains - Add 'not for files you already know' to explore section header Fixes code-yeongyu#2124, fixes code-yeongyu#1967
…hus variants The prompt update from sisyphus.ts was not applied to the gpt-5-4 and default variant files. This aligns all three sisyphus prompt variants to use the updated background result handling guidance.
62abecd to
f1f682c
Compare
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
Changes
src/agents/sisyphus.ts: RemoveContinue working immediatelyinstruction (which models interpreted as "do ALL work yourself, ignore agents"). Restructure Background Result Collection steps to: (1) launch agents, (2) do DIFFERENT independent work if any, (3) otherwise END RESPONSE and wait for system-reminder, (4-6) collect results and clean up.src/agents/dynamic-agent-prompt-builder.ts: Addnot for files you already knowto explore section header to reduce duplicate reads when the parent already knows file locations.Testing
Tested locally with 3 models via
opencode run --format json:Related Issues
Closes #2124
Closes #1967
Summary by cubic
Make the orchestrator wait for explore/librarian background agents before proceeding, preventing duplicate work and premature answers (fixes #2124, #1967). Also scope the Explore Agent to discovery-only when file locations are already known.
background_outputand clean up withbackground_cancel.Written for commit f1f682c. Summary will update on new commits.