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
There is a very high probability of encountering indentation bugs when using the Edit tool in OpenCode. #10656
When OpenCode attempts to invoke the Edit tool, certain models such as GLM4.7, MiniMax M2.1, and Big Pickle (provided by OpenCode Zen) experience this issue, while others like GitHub Copilot's Haiku D4.5 work normally.
Plugins
No response
OpenCode version
OpenCode 1.1.36
Steps to reproduce
When attempting to modify an existing method with the corresponding model, there is a high probability of encountering this issue.
I've tracked this down to models being confused as to how to construct the replacement strings for use with the "edit" tool after seeing the context given by the "read" tool. This commit albertov@84ce6c1 fixes it nicely for my use case (indentation-sensitive haskell code)
I have the same problem tying to work with python code with opencode 1.1.53 and lot of models:
devstrall 2 small
GLM 4.7 flash
Qwen3-coder-next
These indentation errors slow down a lot the agents and waste context space.
At some point some models like q3cn write a bash or python script in order to "manually" fix the indentation.
@albertov I tried your fix and for now I don't see indentation errors anymore !
Thanks !
I also face this issue with glm 4.7-flash and qwen3-coder-next they keeps messing up indents. almost unusable, need 4 or 5 round to fix the indents, sometimes editing the files manually to get it fixed. this ruins the usefulness of opencode. running version 1.4.3. I can't ping anyone on discord, not 1 million horses could drag me there! @rekram1-node hope this gets to you
Activity
albertov commentedon Feb 3, 2026
I've tracked this down to models being confused as to how to construct the replacement strings for use with the "edit" tool after seeing the context given by the "read" tool. This commit albertov@84ce6c1 fixes it nicely for my use case (indentation-sensitive haskell code)
albertov commentedon Feb 3, 2026
Pushed fixed here #12030
Nico-Guyon commentedon Feb 8, 2026
I have the same problem tying to work with python code with opencode 1.1.53 and lot of models:
These indentation errors slow down a lot the agents and waste context space.
At some point some models like q3cn write a bash or python script in order to "manually" fix the indentation.
@albertov I tried your fix and for now I don't see indentation errors anymore !
Thanks !
rekram1-node commentedon Feb 12, 2026
This should be fixed in latest releases
I discussed w/ @albertov
IF you still have this issue please please ping me in discord!
Neelesh2512 commentedon Feb 23, 2026
Hi @rekram1-node I am using latest opencode version and still facing this issue
albertov commentedon Feb 24, 2026
I'm also seeing issues, seems model dependent, t's Sonnet 4.6 in this case. I will try to fix again when I get a chance
contentnation commentedon Apr 12, 2026
I also face this issue with glm 4.7-flash and qwen3-coder-next they keeps messing up indents. almost unusable, need 4 or 5 round to fix the indents, sometimes editing the files manually to get it fixed. this ruins the usefulness of opencode. running version 1.4.3. I can't ping anyone on discord, not 1 million horses could drag me there! @rekram1-node hope this gets to you