anomalyco / anomalyco/opencode
Doom-loop detection misses periodic tool-call cycles
@kitlangton is already working on this.
Since Sep 7, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The doom_loop guard detects three adjacent identical tool calls, but misses alternating calls such as A, B, A, B, A, B. Repeating the same multi-call block never satisfies the current last-three-parts comparison.
I reproduced this with a deterministic normalized stream driving the real SessionProcessor, without changing production code. The period-2 regression fails because processing returns continue without asking permission. A period-1 control (A, A, A, with distinct call IDs) passes.
Plugins
None in the reproduction fixture.
OpenCode version
Upstream dev at 57ef3828431790c53f8f333c7ffbfe88770a1812.
Steps to reproduce
-
Configure
doom_loop: "ask"and create a fresh assistant processor. -
Supply a normalized stream with
step-start, followed by these calls in order. Give every call a unique ID and follow each with a successfultool-result:lookup({query: "a"}) call-a1 search({query: "b"}) call-b1 lookup({query: "a"}) call-a2 search({query: "b"}) call-b2 lookup({query: "a"}) call-a3 search({query: "b"}) call-b3 -
End with
step-finish(tool-calls)andfinish(tool-calls). -
Observe six completed tool parts, no
permission.askedevent, and processor resultcontinue.
Expected: three complete repetitions of this two-call block should reach the existing doom_loop permission gate, just as three repetitions of a single call do.
This is distinct from #46272's consecutive-identical-call stop threshold and #32089's cross-message history scan. The sequence above occurs entirely within one active processor. It does not require changing permission actions or adding an unconditional stop.
Operating System
Linux. Reproduced in the processor Effect test suite, without an external provider.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.