You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If your issue is distinct from those (e.g. different trigger conditions or model), please add more context such as your OpenCode version, OS, and steps to reproduce so maintainers can distinguish it.
This is likely the model's own issue. Try to locate the exact prompt pattern that would reproduce this behavior (this tool might be helpful) and report to the model's dev team instead.
It inserts a request-local user boundary before the repeated tool-call tail and prunes stale prior thought signatures while keeping the current turn signature intact. Not a general doom-loop detector fix, but it may help with this exact “same tool call again” pattern.
Actually, there's an option in OpenCode that lots of users might not know. You can set the permission doom_loop to deny to halt identical tool calls repeated 3+ consecutive times.
Actually, there's an option in OpenCode that lots of users might not know. You can set the permission doom_loop to deny to halt identical tool calls repeated 3+ consecutive times.
Part of the problem with this is that often doom loops end up being the same 2-3 repeated calls, so it becomes a little more annoying to detect
e.g.,
<thinking>let me check X
read Y/X
<thinking> X isn't in Y, let me check Zread Z/X<thinking> X isn't in Z, let me check Y
read Y/X
...
I think another solution would be to add a hard limit to steps rather than soft suggestion. Or at least, a way to safeguard against failures becoming too costly
If anyone has a trace of a loop, runtape (https://github.com/RehanMohammed985/runtape) can rerun the call that repeated, with each part of the context removed, to show what keeps the model calling it again (often the previous result or how it's formatted), and check fixes on that exact call. Glad to run it on one.
Activity
github-actions commentedon May 21, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from those (e.g. different trigger conditions or model), please add more context such as your OpenCode version, OS, and steps to reproduce so maintainers can distinguish it.
Arcadi4 commentedon May 21, 2026
This is likely the model's own issue. Try to locate the exact prompt pattern that would reproduce this behavior (this tool might be helpful) and report to the model's dev team instead.
isac322 commentedon May 29, 2026
I hit a very similar repeated-tool-call loop with Gemini and published a tiny OpenCode plugin workaround: https://github.com/isac322/opencode-gemini-dejavu / npm: opencode-gemini-dejavu
It inserts a request-local user boundary before the repeated tool-call tail and prunes stale prior thought signatures while keeping the current turn signature intact. Not a general doom-loop detector fix, but it may help with this exact “same tool call again” pattern.
Arcadi4 commentedon May 30, 2026
Actually, there's an option in OpenCode that lots of users might not know. You can set the permission
doom_looptodenyto halt identical tool calls repeated 3+ consecutive times.See https://opencode.ai/docs/permissions
Dr-Hughes commentedon Jul 27, 2026
Part of the problem with this is that often doom loops end up being the same 2-3 repeated calls, so it becomes a little more annoying to detect
e.g.,
I think another solution would be to add a hard limit to
stepsrather than soft suggestion. Or at least, a way to safeguard against failures becoming too costlygithub-actions commentedon Sep 26, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
RehanMohammed985 commentedon Oct 8, 2026
If anyone has a trace of a loop, runtape (https://github.com/RehanMohammed985/runtape) can rerun the call that repeated, with each part of the context removed, to show what keeps the model calling it again (often the previous result or how it's formatted), and check fixes on that exact call. Glad to run it on one.