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
Bug: New MiMo 2.6 Flash is unusable due to it ending up in infinite loops #50678
just start opencode and select model MiMo 2.6 Flash. after a few iterations it will make too calls (Glob, Find, Read) and it ends up in a spam of the same calls, arbitrary file paths, same file paths, redundant calls, etc.)
The root issue — repeated identical tool calls (Glob, Find, Read) with no loop termination — is tracked across those issues. #47759 in particular describes a gap in the existing doom-loop guard that would explain why MiMo v2.6 Flash can still loop even with the current detection in place.
changed the title [-]Bug: New MiMo 2.6 Flash is unusable due to ending up in infinite loops[/-][+]Bug: New MiMo 2.6 Flash is unusable due to it ending up in infinite loops[/+]on Sep 22, 2026
provider xiaomi, model mimo-v2.6-flash, variant high, agent build
local git workdir (path and project name redacted)
session ses_f4a3eb1fbffeu2w9LHRNv8az7t
local opencode DB and log, run eaa73832
Session totals are mixed (it also ran muse-spark): 101,462,902 input tokens, 817,777,255 cache-read tokens, cost 13.63. The loop below is one assistant message in my session.
What happened
After an automatic compaction, opencode injected a synthetic turn (role user) and the model continued. On processor step 31 a single assistant stream emitted the same read call hundreds of times and never finished the step.
Parent user part prt_0cac87d1f001CAfVxYqMRkzieJ:
{"type":"text","synthetic":true,"metadata":{"compaction_continue":true},
"text":"Continue if you have next steps, or stop and ask for clarification if you are unsure how to proceed."}
No later loop step=32, no exiting loop, no stream error for this session/message. I left the session running, then stopped opencode with CTRL+C. I restarted opencode and, in the same session, typed "continue". The next log line for this session is a new run 36 minutes later:
started 20:33:24–21:03:06, all ended 21:03:33–21:05:15
running, identical input
145
started 21:03:07–21:05:09, time.end null
other reads (different offset/limit)
14
20:33:15–20:33:27
pending
1
21:05:09
All 101 completed outputs are byte-identical (1812 bytes): the file ends at line 512, so offset=483, limit=45 is the tail of buyers.test.tsx, and every call returned that same tail including (End of file - total 512 lines).
Timing:
inter-start of the identical calls: min 388 ms, median ~500 ms
no completed call finished before 21:03:33 — 101 calls were in flight at once (started, not yet ended)
execution delay for a completed call: min 79.6 s, median 93.1 s, max 1816 s
after the queue drained, 145 more identical calls were accepted and left running (consistent with CTRL+C while they were queued)
This was not a retry of a failed read. The tool succeeded every time it was allowed to finish, with the same body, and the model kept emitting the same call for ~32 minutes inside one step.
Why this looks like an opencode bug, not just a bad model
I compared every session for this workdir in my local opencode DB:
model
assistant messages
max tool parts in one message
tool parts left running
xiaomi/mimo-v2.6-flash
412
261
152
meta/muse-spark-1.3-contributor
5976
11
2
others
—
≤ 8
≤ 1
The processor loop itself stopped at step 31 (loop ... step=31 is the last step log for run eaa73832). The unbounded repeat is inside a single stream: hundreds of parallel tool calls, no per-step tool-call cap, no identical-call dedupe, and no doom-loop stop. When I cancelled the turn, opencode did not mark the in-flight tool parts completed or errored; 145 stay running.
Repro shape
Long build session on xiaomi/mimo-v2.6-flash until compaction fires.
Synthetic "Continue if you have next steps..." turn.
Model emits read with a fixed {filePath, offset, limit}.
opencode executes it (returns the same slice, including EOF) and feeds the result back, but the same stream keeps emitting the same call ~2/s for tens of minutes.
No step cap, no identical-call guard. I had to stop opencode with CTRL+C, then restart it and type "continue" in the same session. Tool rows stay status=running.
Suggested fix
Cap tool calls per step (and per identical {tool, input} hash). After N identical successful results, stop the step and return the result instead of calling again.
On session abort, mark in-flight tool parts error/cancelled instead of leaving them running.
Record stream usage even when the stream is aborted, so a hung step is visible in session token totals.
Activity
github-actions commentedon Sep 22, 2026
This issue might be a duplicate of existing issues. Please check:
The root issue — repeated identical tool calls (Glob, Find, Read) with no loop termination — is tracked across those issues. #47759 in particular describes a gap in the existing doom-loop guard that would explain why MiMo v2.6 Flash can still loop even with the current detection in place.
[-]Bug: New MiMo 2.6 Flash is unusable due to ending up in infinite loops[/-][+]Bug: New MiMo 2.6 Flash is unusable due to it ending up in infinite loops[/+]kamilchm commentedon Sep 24, 2026
Same happened for me a few times.
Environment
1.18.30(session.version)xiaomi, modelmimo-v2.6-flash, varianthigh, agentbuildses_f4a3eb1fbffeu2w9LHRNv8az7teaa73832Session totals are mixed (it also ran muse-spark): 101,462,902 input tokens, 817,777,255 cache-read tokens, cost 13.63. The loop below is one assistant message in my session.
What happened
After an automatic compaction, opencode injected a synthetic turn (role
user) and the model continued. On processor step 31 a single assistant stream emitted the samereadcall hundreds of times and never finished the step.Parent user part
prt_0cac87d1f001CAfVxYqMRkzieJ:{"type":"text","synthetic":true,"metadata":{"compaction_continue":true}, "text":"Continue if you have next steps, or stop and ask for clarification if you are unsure how to proceed."}Log:
No later
loop step=32, noexiting loop, nostream errorfor this session/message. I left the session running, then stopped opencode with CTRL+C. I restarted opencode and, in the same session, typed "continue". The next log line for this session is a new run 36 minutes later:The log has no abort/SIGINT line for run
eaa73832, even though I stopped opencode with CTRL+C.The stuck message
msg_0cad2769f001AFBSUvSRtNKKAEmodelID=mimo-v2.6-flash,providerID=xiaomi,variant=highfinishis null,tokensare all 0,costis 0 (stream never closed, so usage was never recorded)step-start, 1reasoning, 261tool, 0step-finish, 0textReasoning text (the model knew exactly which lines it wanted, then called read anyway):
The repeated call
246 of 261 tool parts are the same call, each with a unique
callID:{"type":"tool","tool":"read","callID":"call_b554fa7b433e4796a002b20e", "state":{"status":"completed","input":{ "filePath":"<redacted>/buyers.test.tsx", "offset":483,"limit":45}}}time.endnullAll 101 completed outputs are byte-identical (1812 bytes): the file ends at line 512, so
offset=483, limit=45is the tail ofbuyers.test.tsx, and every call returned that same tail including(End of file - total 512 lines).Timing:
running(consistent with CTRL+C while they were queued)This was not a retry of a failed read. The tool succeeded every time it was allowed to finish, with the same body, and the model kept emitting the same call for ~32 minutes inside one step.
Why this looks like an opencode bug, not just a bad model
I compared every session for this workdir in my local opencode DB:
runningThe processor loop itself stopped at step 31 (
loop ... step=31is the last step log for runeaa73832). The unbounded repeat is inside a single stream: hundreds of parallel tool calls, no per-step tool-call cap, no identical-call dedupe, and no doom-loop stop. When I cancelled the turn, opencode did not mark the in-flight tool parts completed or errored; 145 stayrunning.Repro shape
buildsession onxiaomi/mimo-v2.6-flashuntil compaction fires.readwith a fixed{filePath, offset, limit}.status=running.Suggested fix
{tool, input}hash). After N identical successful results, stop the step and return the result instead of calling again.error/cancelledinstead of leaving themrunning.thdxr commentedon Oct 11, 2026
Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (
opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.— from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊