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
Opencode + Qwen gives JSON output instead of writing to disk #29757
that was missing, llama3.1:8b-32k and lama3.1:8b seem to work. You need to specify the full path location where to write files but at least seems to produce something. Qwen still completely broken
With working llama 3.1 what i'm noticing is that it is not able to write in correct locations:
I'm also having the same problem with any of the qwen models I've tried.
Basically none of the invocation commands from qwen work in OpenCode.
qwen2.5-coder:7b responses are different from qwen3.5:9b responses, but neither work.
This problem is also not isolated to OpenCode. I tried running Claude-Code locally and connecting it to Ollama -> qwen2.5-coder:7b and basically it has the same problem as OpenCode.
As qwen2.5 and qwen3.5 responses seem to be different, the only way this could be resolved would be for opencode to be able to be configured to handle the difference response formats for these 2 LLMs, and as they are not the latest version of qwen, I doubt they would want to devote effort to support them :-(
As Gemma4 seems to have worked for some people, I'll give that a go
Activity
github-actions commentedon May 28, 2026
This issue might be a duplicate of existing issues. Please check:
QQi44 commentedon May 30, 2026
I have this issue too. It happens with windows
QQi44 commentedon May 30, 2026
u can sove this issue by Increase context length
Virgula0 commentedon May 31, 2026
I'm using a bigger context length and it doesn't work on each of the following models, context size: 32k. Same problem of the OP. Version
1.15.10Update:
adding
that was missing,
llama3.1:8b-32kandlama3.1:8bseem to work. You need to specify the full path location where to write files but at least seems to produce something. Qwen still completely brokenWith working llama 3.1 what i'm noticing is that it is not able to write in correct locations:
dvictori commentedon Jun 1, 2026
I tested with both default and 16k context length and none worked
Virgula0 commentedon Jun 1, 2026
I found something working:
google/gemma-4-E4B
But with continue.dev visual studio code extension, not using opencode. Seems to have a lot of problems with small models
dvictori commentedon Jun 3, 2026
Upgraded to opencode v1.15.13
Still, local Qwen model will not write to disk.

Changing model to DeepSeek V4 Flash Free (from OpenCode Zen), it works as expected and the file is writen.

Looks like it's a specific problem from Qwen?
brtmax commentedon Jun 16, 2026
Using @Virgula0 suggestion (Gemma 4 E4B) it works for me as well, but I could not get it to work with Qwen 2.5B Instruct.
Maybe a heads-up for someone else: I had to create a new session in OpenCode for it to work
DaGeRe commentedon Jul 23, 2026
I also have the same issue and couldn't find any solution.
When using qwen2.5-coder:32b, the output is:
And no file is written.
With Gemma4, the same works nicely:
My opencode.json looks like this (with the line
"model": "ollama/qwen2.5-coder:32b",being changed when gemma4 is used):I used 1.18.4 and ollama 0.32.1, so everything should be up to date. If there is any workaround, I'd be happy to know about this.
EDIT qwen3.6:27b works, since this is much newer and has comparable size, it probably makes sense to just switch to this model.
github-actions commentedon Sep 23, 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.
rogerclarkmelbourne commentedon Oct 31, 2026
I'm also having the same problem with any of the qwen models I've tried.
Basically none of the invocation commands from qwen work in OpenCode.
qwen2.5-coder:7b responses are different from qwen3.5:9b responses, but neither work.
This problem is also not isolated to OpenCode. I tried running Claude-Code locally and connecting it to Ollama -> qwen2.5-coder:7b and basically it has the same problem as OpenCode.
As qwen2.5 and qwen3.5 responses seem to be different, the only way this could be resolved would be for opencode to be able to be configured to handle the difference response formats for these 2 LLMs, and as they are not the latest version of qwen, I doubt they would want to devote effort to support them :-(
As Gemma4 seems to have worked for some people, I'll give that a go