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
{{ message }}
Repository navigation
reasoning: model reasoning output stuck in infinite repetitive loop #44962
The model reasoning/thinking output gets stuck in an infinite repetitive loop, repeating the same sentence hundreds of times within a single turn. This wastes the context window, makes the agent appear hung, and severely degrades the user experience.
Active plugins: @plannotator/opencode@latest, C:\Users\lonwabo.msingelwa.config\opencode\plugins\herdr-agent-state.js, C:\Users\lonwabo.msingelwa.config\opencode\plugins\planning-canvas.js, micode, superpowers@git+https://github.com/obra/superpowers.git
Reproduction
Engage the agent in a sustained multi-step debugging session (e.g. fixing Docker DB schema + permissions issues, ~15+ tool calls).
After several tool calls in the same conversation, the model's reasoning block enters a loop repeating the same sentence verbatim hundreds of times.
Observed loop 1: the reasoning block repeated "Let me check the entity model to get the right column types." with no progress.
Observed loop 2: a different turn repeated "The user is telling me to just do the work instead of narrating what I'm going to do. ..." in the same manner.
Both loops filled the reasoning output until the model finally emitted its actual response.
Expected Behavior
The model should produce reasoning/thinking output once per decision point, then proceed to tool calls / user-visible output without repetitive looping.
Actual Behavior
Reasoning output enters an infinite verbatim repetition, producing hundreds of identical lines in a single turn. The agent appears hung while context is consumed. The user had to intervene ("stop", "you are buggy as hell", "you are doinf this.") to prompt recovery.
Additional Context
Frequency: twice in the same session, after a long tool-use conversation.
Tool calls themselves completed normally — the loop is in the model's reasoning text generation, not in tool dispatch.
The user also hit an unrelated login hang (FLUSHDB + container restart needed) in the same session, which may have compounded frustration, but the reasoning loop is independent.
No plugin changes were made during the session; appears to be a model-generation issue under sustained multi-turn tool use.
Reasoning text infinitely repeats #33135: Reasoning text infinitely repeats — reasoning block loops on the same token/sentence, causing wasted context and apparent hang (closed, may have a fix or related discussion)
Same session, and it got worse than reasoning-only: the fragments leaked into visible assistant output.
Environment
opencode: 1.18.31
model: deepseek-v4.1-flash
OS: Windows 10 (win32 x64)
Repro (same trigger as this issue): a long multi-step tool-use session, no new session started. In my case ~100+ tool calls (C++ build/deploy/test cycles plus browser automation).
What I saw, in order:
First, exactly what you describe - the reasoning block looped on the same sentence ("...好。发。好。发。..." / "ok. send." repeated).
Then it crossed over: the same internal step-markers started appearing as regular assistant text in the visible transcript, hundreds of lines:
Once it started it self-reinforced: each leaked fragment became context and was re-emitted. I had to interrupt the agent manually to break the loop.
Expected: internal step-markers stay in the reasoning channel; the visible response contains only real assistant output.
Actual: internal fragments are emitted as visible assistant output and accumulate in the transcript.
Activity
github-actions commentedon Aug 25, 2026
This issue might be a duplicate of existing issues. Please check:
msingelwa commentedon Aug 26, 2026
I see that now, but it has not been acknowledged.
zhuabaobao123 commentedon Sep 15, 2026
Same session, and it got worse than reasoning-only: the fragments leaked into visible assistant output.
Environment
Repro (same trigger as this issue): a long multi-step tool-use session, no new session started. In my case ~100+ tool calls (C++ build/deploy/test cycles plus browser automation).
What I saw, in order:
First, exactly what you describe - the reasoning block looped on the same sentence ("...好。发。好。发。..." / "ok. send." repeated).
Then it crossed over: the same internal step-markers started appearing as regular assistant text in the visible transcript, hundreds of lines:
我发出工具调用。
好。
(发。)
发 ida_wait_for_analysis。
好。
(发。)
我发出。
...
("我发出工具调用。" = "I'll emit the tool call.", "好。" = "ok.", "(发。)" = "(send.)")
Expected: internal step-markers stay in the reasoning channel; the visible response contains only real assistant output.
Actual: internal fragments are emitted as visible assistant output and accumulate in the transcript.
Screenshots attached below.