Repository navigation
fix(opencode): keep doom-loop guard to real failures across steps - #728
Closed
agenteinstinct1-max wants to merge 1 commit into
Closed
agenteinstinct1-max wants to merge 1 commit into
agenteinstinct1-max wants to merge 1 commit into
Conversation
Co-authored-by: arena-agent <[email protected]>
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 2 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
|
Thanks for your contribution! This PR doesn't have a linked issue. All PRs must reference an existing issue. Please:
See CONTRIBUTING.md for details. |
This was referenced Oct 31, 2026
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window. Feel free to open a new pull request that follows our guidelines. |
This was referenced Oct 31, 2026
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.
Refs #725
The doom_loop guard in
packages/opencode/src/session/processor.tsfired on identical tool parts withstatus !== "pending", so it also counted calls that never ran, calls that succeeded, members of one parallel batch, and the deferred-tool repair placeholder. It now counts only evidence of a sequential no-progress loop.What changed
completed/error) and are not theinvalidplaceholderexperimental_repairToolCallsubstitutes for a deferred tool (that placeholder never executed; its input instructs the retry).step-startinside one, so N identical calls fanned out in one response share a step and never trip the guard. Earlier messages are read back within the current user turn (a new user message is progress, not a loop).DOOM_LOOP_THRESHOLD = 3(the third identical attempt asks), thedoom_looppermission ask with itsalways/ruleset/countdown semantics (feat(permission): auto-deny permission prompts after a countdown #186), and the lazy-load repair message and retry path inllm.ts(untouched).Tests (deterministic,
packages/opencode/test/session/processor-effect.test.ts)Each test stubs
Permission.Serviceto record asks andLLM.Serviceto replay scripted event streams, so there is no prompt countdown or network involved.doom_loopask forlookup.All five fail against the pre-fix guard (verified by stashing the source change), and mutation checks confirm each rule is covered: dropping the distinct-step condition fails (a); accepting non-failures fails (d); not excluding
invalidfails the placeholder test.Verification
bun test test/session/processor-effect.test.ts -t "doom loop"→ 5 pass.bun test test/session→ 834 pass, 8 skip, 1 todo, 1 environment timeout (model-switch during retry > no model switch, 5381 ms against a 5 s limit; passes in isolation).bun run typecheckcannot complete in the sandbox (node OOM at the 2 GB heap limit — also at the unmodified base commit). Scopedtsc --noEmit --skipLibCheckprojects includingsrc/session/processor.tsand the test file (full import graph) both exit clean.oxlinton both files: 0 errors, no new warnings.