Description
When using OpenCode with alibaba-coding-plan-cn/qwen3.6-plus, some sessions fall into repetitive tool-call loops.
What I observe:
- One user turn turns into many assistant turns.
- Adjacent assistant turns often contain nearly identical reasoning.
- Each assistant turn often performs only one tool call, then re-enters the loop.
- The session usually eventually finishes, so this does not look like a storage or transport hang.
- This seems more like a harness-level loop amplification issue that is exposed more often by
qwen3.6-plus.
Local evidence from my machine:
- Session
ses_2845d8980ffemjHrBrf2XpIrY7 had 18 user messages and 114 assistant messages.
- Many adjacent assistant turns repeated almost the same reasoning, especially around checking or updating the same section again after each tool result.
- In a local sample,
qwen3.6-plus sessions showed a higher assistant-to-user ratio than recent opencode-go/glm-5.1 sessions.
- Across stored assistant messages, Qwen also produced many more single-tool turns before reaching a final
stop.
This does not look like a simple “session got stuck forever” bug. It looks more like the loop keeps accepting repeated tool-calls from this model without enough guardrails against repetition.
Relevant code paths that may be involved:
packages/opencode/src/session/prompt.ts
packages/opencode/src/agent/agent.ts
My current suspicion:
- OpenCode keeps looping while the assistant finishes with
tool-calls.
- The default
build agent appears to have no practical default step limit.
- There does not seem to be a repetition guard for “same reasoning / same tool pattern again”.
qwen3.6-plus seems more likely than some other models to produce serial one-tool-at-a-time continuations, which makes the issue much more visible.
Plugins
No custom plugins involved, as far as I can tell.
OpenCode version
Mostly observed on 1.4.3.
Affected local sessions I checked:
1.4.3: ses_2845d8980ffemjHrBrf2XpIrY7, ses_289442f7affexh49ZQ2S655J74, ses_28a631ed9ffedBp4DospJDEqoE
1.4.0: ses_28f1e807cffe55PnIHB9b7fK2C
I also have local qwen3.6-plus sessions on 1.3.13 and 1.4.1, but the strongest examples I inspected were on 1.4.3.
Steps to reproduce
- Configure OpenCode to use
alibaba-coding-plan-cn/qwen3.6-plus.
- Use the default
build agent on a task that requires multiple reads, edits, or repeated verification inside a repo.
- Watch the session timeline.
- In some cases, the assistant will produce many short turns with near-duplicate reasoning and one tool call per turn before finally stopping.
A representative pattern is:
- Assistant reasons briefly.
- Assistant performs one tool call.
- Assistant re-enters with nearly the same reasoning.
- Assistant performs another single tool call.
- This repeats much longer than expected.
Screenshot and/or share link
I do not have a share link attached yet.
I can provide sanitized session details if needed. Example local session IDs:
ses_2845d8980ffemjHrBrf2XpIrY7
ses_289442f7affexh49ZQ2S655J74
ses_28a631ed9ffedBp4DospJDEqoE
Operating System
macOS 26.3.1
Terminal
Not verified from the current environment.
Description
When using OpenCode with
alibaba-coding-plan-cn/qwen3.6-plus, some sessions fall into repetitive tool-call loops.What I observe:
qwen3.6-plus.Local evidence from my machine:
ses_2845d8980ffemjHrBrf2XpIrY7had18user messages and114assistant messages.qwen3.6-plussessions showed a higher assistant-to-user ratio than recentopencode-go/glm-5.1sessions.stop.This does not look like a simple “session got stuck forever” bug. It looks more like the loop keeps accepting repeated
tool-callsfrom this model without enough guardrails against repetition.Relevant code paths that may be involved:
packages/opencode/src/session/prompt.tspackages/opencode/src/agent/agent.tsMy current suspicion:
tool-calls.buildagent appears to have no practical default step limit.qwen3.6-plusseems more likely than some other models to produce serial one-tool-at-a-time continuations, which makes the issue much more visible.Plugins
No custom plugins involved, as far as I can tell.
OpenCode version
Mostly observed on
1.4.3.Affected local sessions I checked:
1.4.3:ses_2845d8980ffemjHrBrf2XpIrY7,ses_289442f7affexh49ZQ2S655J74,ses_28a631ed9ffedBp4DospJDEqoE1.4.0:ses_28f1e807cffe55PnIHB9b7fK2CI also have local
qwen3.6-plussessions on1.3.13and1.4.1, but the strongest examples I inspected were on1.4.3.Steps to reproduce
alibaba-coding-plan-cn/qwen3.6-plus.buildagent on a task that requires multiple reads, edits, or repeated verification inside a repo.A representative pattern is:
Screenshot and/or share link
I do not have a share link attached yet.
I can provide sanitized session details if needed. Example local session IDs:
ses_2845d8980ffemjHrBrf2XpIrY7ses_289442f7affexh49ZQ2S655J74ses_28a631ed9ffedBp4DospJDEqoEOperating System
macOS 26.3.1
Terminal
Not verified from the current environment.