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
Infinite compaction loop on every response even with empty session #31152
OpenCode enters an infinite compaction loop immediately after any message, even "hi" with zero config, no skills, no agents, no commands, and no AGENTS.md/CLAUDE.md files. Every response triggers Build → Compaction → Build → Compaction indefinitely.
@SMohsenM the MiMo V2.5 context limit is actually 1M tokens, and so it's an upstream issue.
Specifically, it's an issue with the Output tokens limit vs the Context tokens limit.
A second diagnostic utility here is that it stopped working without upgrading Opencode. So one day it worked, the next day not. I.e. upstream provider issue.
I dug fairly deeply through the codebase, and there is a way to actively bypass this, but the config change recommended in #31152 (comment) is the better short term approach.
However, I would suggest opencode show an error dialog in such cases as the passed JSON model config has some undefined values in this case, which could be caught, and then a human input box could be allowed.
Activity
github-actions commentedon Jun 6, 2026
This issue might be a duplicate of existing issues. Please check:
If your issue is distinct from all of the above, please add a comment explaining how it differs so maintainers can keep it open.
jiten-core commentedon Jun 7, 2026
this is exaly same thing happend with me
bfanger commentedon Jun 18, 2026
I had this issue too when using a local modal, in my case I was able to solve it by specifing the input limit.
Could be related to #13980
tavurth commentedon Jun 26, 2026
Interesting that this is happening to me too, but seems to be model dependant.
MiMo V2.5(openrouter/xiaomi/mimo-v2.5) started doing this, but swapping to another model still works.Uninstalling and reinstalling openrouter does not fix.
Neither does removing the entire
~/.local/share/openrouter,~/.config/openrouterand~/.cache/opencodefolders.(MiMo was previously working just fine)
Fixed:
~/.config/opencode/config.json{ "provider": { "openrouter": { "models": { "xiaomi/mimo-v2.5": { "limit": { "context": 1000000, "output": 1000000 } } } } } }openrouterwas returning incorrect context for that model. Upstream bug.SMohsenM commentedon Jul 1, 2026
@tavurth I don’t think it’s an upstream bug. Here are the results from https://openrouter.ai/api/v1/model/xiaomi/mimo-v2.5 . The DigitalOcean provider has a 32K context limit and is currently the top provider.
tavurth commentedon Jul 1, 2026
@SMohsenM the MiMo V2.5 context limit is actually 1M tokens, and so it's an upstream issue.
Specifically, it's an issue with the
Output tokenslimit vs theContext tokenslimit.A second diagnostic utility here is that it stopped working without upgrading Opencode. So one day it worked, the next day not. I.e. upstream provider issue.
I dug fairly deeply through the codebase, and there is a way to actively bypass this, but the config change recommended in #31152 (comment) is the better short term approach.
However, I would suggest opencode show an error dialog in such cases as the passed JSON model config has some undefined values in this case, which could be caught, and then a human input box could be allowed.
github-actions commentedon Aug 31, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.