[BUG] doom_loop asks once, then the same successful bash command repeats hundreds of times
Description
In MiMoCode 0.1.14, Plan mode + xiaomi/mimo-v2.6-pro, the doom_loop guard asked exactly once and then let the same successful bash command repeat for several minutes.
The command was an extension census over git ls-files. Every run succeeded with the same stdout (2 lock). After the single permission reply, it kept going at about one call per second until an unrelated subagent notification ended the turn. The next model request then failed with HTTP 402 insufficient_balance.
This is the CLI, not Desktop, and the calls were serial and successful. Related but different reports: #1162 (three identical calls, then the agent moves on; v0.1.1) and #2436 (Desktop, mimo-x-flash, a burst of parallel calls, loop_streak suspected).
What the 0.1.14 binary does
session.processor sets T0L = 3. On a tool-call event it takes the last 3 parts of the current assistant message. If they are all the same tool with the same JSON.stringify(input), it asks:
permission: "doom_loop"
patterns: [toolName]
always: [toolName]
Default ruleset is doom_loop: "ask". The dialog title is "Continue after repeated failures" and the body is "This keeps the session running despite repeated failures." These calls were not failures.
Timeline (CST, UTC+8, 2026-09-22), session ses_-ffe5f394a5642ffea802CqOU5:
- 09:23:09 Plan session starts. Task is a read-only architecture survey. Explore subagents are already returning reports before the loop.
- 09:23:15 and 09:23:20: two
ECONNRESETs tohttps://api.xiaomimimo.com/v1/chat/completions, both retried (isRetryable: true). The loop starts later, after a healthy stretch of tool use. - 09:25:27: one
doom_loopask, idper_g001a0c6b7c385001MAAoxVAdo,patterns: ["bash"]. - 09:25:58: one reply to that permission.
- 09:25:50–09:32:10: no second
doom_loopask. The same pipeline completes about 11 times per 10 seconds. - 09:32:10: last copy. An actor notification at 09:32:20 ends the turn. The model then acknowledges the loop in text.
- 09:34:18: the following completion stream errors with HTTP 402,
type: insufficient_balance.
Counts from the session database: 454 executions of the exact pipeline below, 597 completed bash calls overall (137 distinct command strings). The UI status during the loop was Writing command...; the viewport only showed the latest few copies, so the session looked like a short repeat.
Worker log mtime stayed at 09:26:57 while those calls were still being written to the session DB. The log grew again when the 402 error was recorded (the error object embeds the request). Per-call bash-tool lines do not cover this stretch.
The repeated command (path redacted):
git -C <repo> ls-files <subdir> \
| grep -vE '\.(py|md|html|css|js|json|txt|gz|service|timer|sh|yaml|yml|toml|cfg|ini|conf|php|png|ico|db|whl)$' \
| sed 's/.*\.//' | sort | uniq -c | sort -rn
Stdout every time: 2 lock.
Expected
One answer to doom_loop should not authorize the rest of the session. The guard should ask again on the next streak of 3, or stop the turn. The prompt should describe repeated identical calls, including ones that succeed. always: [toolName] on this ask is what makes a single approval look like a standing allow for that tool.
Plugins
none
MiMoCode version
0.1.14
Steps to reproduce
- MiMoCode 0.1.14, Plan mode, model
xiaomi/mimo-v2.6-pro, permissions left at the default (doom_loop: ask). - Ask for a read-only architecture / cleanup survey of a local git repo.
- Wait until the plan agent starts classifying tracked files with the
git ls-files | grep -vE … | sed | sort | uniq -cpipeline above. - When the
doom_loopprompt appears, reply to allow it. - The same command keeps running about once a second, with identical stdout, and the prompt does not come back.
I do not have a smaller synthetic prompt that forces this on demand. The trigger here was an open-ended survey after the explore subagents had already returned enough to stop.
Screenshot and/or share link
No /share link. During the loop the TUI shows the same command block stacked a few times, stdout 2 lock, and the status Writing command....
Operating System
Fedora Linux 44 (Workstation Edition), kernel 7.2.5-200.fc44.x86_64
Terminal
Ptyxis. The REPL shell is fish. The bash tool reports /usr/bin/bash.
Thanks for the detailed reproduction — the always: [toolName] part looks especially important here because this seems slightly different from the broader V2.6 tool-call flooding reported in #2482.
MiMoCode 0.1.15 has now been released. Have you had a chance to reproduce this specific sequence on 0.1.15?
3 identical successful bash calls → doom_loop prompt → Allow → same identical command continues without another doom_loop prompt
If it still reproduces, I think it would be useful to isolate whether approving doom_loop is effectively turning the generated always: [toolName] into a session-wide Bash permission, rather than authorizing only that detected streak.
A small synthetic repro using a harmless deterministic command could separate that permission-path issue from the V2.6 model behavior itself.
If you can confirm it still happens on 0.1.15, I’m happy to dig into that path.
Thanks — this clears up an important distinction, and the Allow once result rules out the persistence behavior I was wondering about.
Your 0.1.15 test makes the remaining doom_loop behavior interesting for a different reason: the permission is being triggered by repeated identical tool calls, but the UI describes the condition as “repeated failures” even when every invocation succeeds.
That creates a potentially dangerous semantic mismatch around Allow always. A user seeing “Continue after repeated failures” may reasonably interpret the choice as allowing the current repeated condition to continue, while the actual effect is to persistently approve future doom_loop matches for the bash pattern until restart.
In other words, the mechanism appears to be behaving consistently with the permission that was selected, but the permission being granted is broader in time than the warning makes obvious.
I think there are now two separate questions worth keeping apart:
Permission/UX: should a loop-safety guard offer Allow always at all, or at minimum explicitly say that choosing it disables future doom_loop prompts for matching Bash calls until MiMoCode restarts?
Execution safety: even with doom_loop persistently approved, should there still be a non-overridable upper bound for identical successful calls/results? A persistent permission and a runaway-execution circuit breaker do not necessarily need to be the same mechanism.
The second point seems especially relevant to the original 454-call session. Even if Allow always was intentional, approving a warning once probably shouldn’t imply that an identical successful command can execute hundreds of times without another independent safety boundary.
The 16-call flooding limit in 0.1.15 may now provide that second boundary for large single-response batches, but your original case was serial over several minutes, so it would be useful to know whether that limit also prevents the original pattern or only addresses oversized batches such as #2482.
I wouldn’t treat #2491 as a fix for this either, since as you noted it targets the separate oversized-batch recovery path.
Thanks for testing both permission choices — that narrows this down considerably.