[BUG] V2.6 emits thousands of rotating tool calls in one generation; doom_loop never fires and the next turn returns 0 tokens
Description
MiMo Code 0.1.14 plus mimo-v2.6-pro / mimo-v2.6-flash spends an entire model generation emitting tool calls, then the next turn has no room left to answer. This is a different failure from #2474.
#2474 is the case where the same bash input repeats, doom_loop asks once, and Allow lets the rest run. The sessions below mostly never ask, because the calls rotate through a small set of arguments. Adjacent calls are not identical, so the tail-of-3 check cannot match.
On the same install, the same repo, and the same morning, mimo-v2.5-pro did not do this: 296 tool calls, 267 distinct inputs, a few calls per step, and it finished a documentation audit. The flood started on the turns that used V2.6.
What 0.1.14 actually checks
session.processor sets T0L = 3. On each tool-call it looks at the last 3 parts of the current assistant message. It asks only when all 3 are the same tool, JSON.stringify(input) is identical, and none are pending. Default is doom_loop: "ask", and the ask is sent with always: [toolName]. The dialog says "Continue after repeated failures."
Text-loop recovery hashes the whole step (wyL = 5, trigger gtH = 3, NWH = 2 recoveries). One generation is one hash, however many tool parts it contains. The n-gram path did not fire either: the worker log has no text loop: recovery injected and no text n-gram: recovery injected. These turns have almost no reasoning (48 reasoning tokens on a 127,952-token generation). The repetition is in the tool-call channel.
There is also only one service=llm … stream line for the hour-long turn. Tool results are applied locally as the stream arrives. They are not sent back to the model until the step ends, so the sampler is not conditioning on the file contents it already requested.
packages/opencode/src/session/toolcall-flooding.ts is not in the v0.1.14 tag (GitHub contents API returns 404). It landed on main in #2463 (merged 2026-09-21) and caps a generation at 16 calls, cancelling call 17 before execution. Latest release is still v0.1.14 (2026-09-02), so that cap is not in the binary that reproduced this. #2475 then reports that once the cap exists, cancelling the batch makes the model retry the same batch. A cap without a hard stop after repeated cancels will trade a one-hour execution for a retry loop.
Session 1 — rotating reads, no doom_loop ask
CLI, Build, xiaomi/mimo-v2.6-flash. Session ses_-ffe5f39234038ffeYglp8uAbZ. Prompt: read the repo, rewrite the docs, push.
- Assistant
msg_g001a0c6dcc07c0018CQuUQH4W, 10:05:51–11:05:51 CST. - One generation: 4,120 tool calls, 4,120 distinct
call_*ids, 35 distinct inputs. Max run of identical adjacent calls: 1. - The set is the same survey repeated:
readofREADME.md,PROGRESS.md,LAYOUT.md,DEVELOPMENT.md,SERVER-OPERATIONS.md,FOCUS-MANAGEMENT.md,docs/README.md, plusglob **/*.md. Each of those reads ran about 370 times. Every completedreadreturned the same file body (not truncated). - Usage on that step: input 9,797, output 127,952, reasoning 48.
finishstored asother. Configuredlimit.outputfor this model is 131,072. The last part is aninvalidtool whose JSON was cut off mid-read. - Worker log
2026-09-22T020516263Zhas thestreamline at 02:05:51 UTC and the nextstep=1at 03:05:52 UTC. Nodoom_loopline in that file. - Next assistant step, 11:05:53–11:08:15: input 1,028,090, output 0, reasoning 0,
finish: length, total 1,048,570 against a 1,048,576 context limit. The client then inserted the empty-answer reminder. Two short normal steps followed, then another generation (msg_…VyHPpxMfR) emitted 721 calls (676bash, 45edit) until abort at 11:13. Eleven edits failed with "String to replace not found".
Session 2 — alternating task updates, no ask
Same CLI, user switched to xiaomi/mimo-v2.6-pro and asked to start the doc rewrite over. Session ses_-ffe5f39342a45ffeUcyT6yyVD.
- One unfinished assistant message at 10:04:32: 106 tool calls, 12 distinct inputs, max identical adjacent run 1.
- Pattern:
task start T5× 52 alternating withtask done T4× 52.
Expected
- A single generation should not be able to execute thousands of tool calls. #2463's cap of 16, shipped in a release, would have stopped session 1 at call 17 and would not have written 4,120 results into the transcript.
- After a flood cancel, the turn should hard-stop once the model repeats the cancelled batch (#2475). Resuming sampling with only a reminder still leaves V2.6 free to emit another oversized batch.
doom_loopshould also trip when a small set of inputs cycles (A,B,C,A,B,Corstart T5/done T4). The identical-tail check is blind to that shape.- One Allow on
doom_loopshould not passalways: [toolName](#2474). Reject is the only stop, and the copy describes failures, while these calls succeed. - Tool results from a flooded step should not be replayed in full on the next request. Session 1's follow-up was input 1,028,090 and output 0, so the user cannot type "continue" in that session and get work done.
What does not stop it on 0.1.14
agent.stepslimits later model round-trips. This flood is one round-trip.permission.doom_loop: "deny"blocks the third identical input. It does not see a rotating set.- Aborting after the hour still leaves the transcript full. A new session is required.
Plugins
none
Background install of @mimo-ai/plugin failed at startup with NpmInstallFailedError (fetch() proxy.url must be a non-empty string). The model requests still completed. Unrelated to the flood.
MiMoCode version
0.1.14 (~/.mimocode/bin/mimo --version). Latest GitHub release is also v0.1.14 (2026-09-02). The flooding guard from #2463 is on main only.
Steps to reproduce
- MiMo Code 0.1.14, Build, model
xiaomi/mimo-v2.6-flashorxiaomi/mimo-v2.6-pro. Leave permissions at the default (doom_loop: ask). - Ask it to read a multi-doc repo and rewrite the docs.
- Watch the first assistant step. It keeps issuing
read/glob/taskcalls for the same small set of paths, with a newcall_*id each time, and nodoom_loopprompt. - Let it run. The step ends near the output cap (here 127,952 tokens, about 60 minutes) on a truncated tool call.
- Send another message in the same session. The next completion comes back with
finish: lengthand 0 output tokens.
I do not have a one-line prompt that forces this on demand. It showed up on the first open-ended V2.6 turn after a normal V2.5 session, and again when V2.6 was asked to restart the same task. Other people are seeing the same model behavior outside this CLI: OpenCode thread, 2026-09-21 ("2.6 keeps looping… reading the same file 100 times").
Screenshot and/or share link
No /share link. Counts are from ~/.local/share/mimocode/mimocode.db (part / message) and the worker log named above.
Related:
- #2474 — identical successful
bash,doom_loopasks once, Allow continues the streak - #2463 — cap at 16, merged to
main, not in the v0.1.14 release - #2475 — with that cap, a cancelled batch is retried
- #2436 — Desktop, parallel identical burst, context poisoning
- #1162 — three identical calls across steps, then the agent moves on (v0.1.1)
Operating System
Fedora Linux 44 (Workstation Edition)
Terminal
Ptyxis. The REPL shell is fish. The bash tool reports /usr/bin/bash.
I am also seeing this issue with MiMo V2.6 Pro and Flash when using Opencode. It makes the models basically unusable.
The replacement fix is in #2491; #2484 and #2485 are closed.
I reproduced the newer failure with the installed build: a 17-call batch was cancelled before producing observations, then retried until the recovery budget stopped the task. The replacement lets MiMo’s compatible stream yield its first 16 complete local calls through the normal validation/permission/failure gates; call 17 does not execute. Unsafe or incomplete batches retain cancellation with a per-turn recovery limit.
The compiled candidate completed the original repository-wide documentation work using Token Plan V2.6 Flash. Fresh V2.6 Pro sessions found content defects, Flash corrected them, and the final independent review passed. Both models exited normally; actual file changes and checks were inspected. The installed candidate also passed my manual test. Local CI-equivalent tests: 5,943 passed, 64 skipped, zero failures.
I noticed the overlapping upstream experiment #2487 and linked it explicitly in #2491. It admits one call per flooded response; #2491 keeps the existing 16-call bound specifically for the MiMo-compatible path. I have not run a same-workload comparison against #2487, so these results do not establish which approach is better.
This does not change cross-step periodic-loop detection or doom-loop approval semantics. I am leaving this issue open because those parts of the report still need their own resolution.