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
Misc. bug: Qwen3.5 with Opencode: Assistant response prefill is incompatible with enable_thinking. #20861
version: 8468 (3306dba)
built with Clang 19.1.5 for Windows x86_64
Operating systems
Windows
Which llama.cpp modules do you know to be affected?
No response
Command line
Problem description & steps to reproduce
when using OpenCode with a Qwen3.5 model with thinking enabled, this error sometimes appear causing the request to fail.
I've tried various combinations of models paramters, llama.cpp settings nad Opencode config with no luck.
any recommendation? My understanding from issues is that this should have been fixed a while ago, but I have been experiencing this error since the release of Qwen3.5 and it happens even on latest build.
First Bad Commit
No response
Relevant log output
Logs
srv operator(): got exception: {"error":{"code":400,"message":"Assistant response prefill is incompatible with enable_thinking.","type":"invalid_request_error"}}
Reacted by ukrospm, Alan Liu, John Wiegley, DalMuDee, Josh Voigts, blockfeed, Ricardo Lima Mazzolli, Remixer Dec, Rory and Daniel Thau
Just add --no-prefill-assistant to avoid this issue. It's because the opencode didn't receive full response from AI provider. It sent incomplete assistant message back again and expect AI could continue to generate the rest of response. That make thinking mode model couldn't handle properly. Just use the --no-prefill-assistant as a workaround until there's a fix from llama or opencode.
If opencode wasn't receiving a full response from the provider (i.e. llama.cpp server), it seems like that would indicate a bug in llama.cpp.
It also only seems to occur for me with Qwen3.5 (27b) with a different agentic framework. I don't seem to get the issue with any other model but it is very intermitent. Next time I encounter this, I'll try and provide logs but just wanted to one up the issue.
{
"model": "qwen3.6-35b-a3b",
"messages": [
{
"role": "user",
"content": "Question: What are the names of the planets in the Solar System?"
},
{
"role": "assistant",
"content": "Answer: "
}
]
}
Response:
{
"error": {
"code": 400,
"message": "Assistant response prefill is incompatible with enable_thinking.",
"type": "invalid_request_error"
}
}
Interestingly, I tried it with Qwen3.5-4B with {"enable_thinking": false} (to make sure reasoning was off), and the content of the response started with <think>\n\n</think>\n\n as if the template wasn't removing it and wasn't incorporating the assistant prefill.
Activity
github-actions commentedon Mar 22, 2026
This issue might be similar or related to the following issue(s):
This comment was auto-generated locally using llama.cpp version: 8456 (b31b30f) on NVIDIA DGX Spark
UltraRabbit commentedon Mar 22, 2026
Just add --no-prefill-assistant to avoid this issue. It's because the opencode didn't receive full response from AI provider. It sent incomplete assistant message back again and expect AI could continue to generate the rest of response. That make thinking mode model couldn't handle properly. Just use the --no-prefill-assistant as a workaround until there's a fix from llama or opencode.
joshvoigts commentedon Apr 4, 2026
If opencode wasn't receiving a full response from the provider (i.e. llama.cpp server), it seems like that would indicate a bug in llama.cpp.
It also only seems to occur for me with Qwen3.5 (27b) with a different agentic framework. I don't seem to get the issue with any other model but it is very intermitent. Next time I encounter this, I'll try and provide logs but just wanted to one up the issue.
marciowb commentedon Apr 16, 2026
Using a custom Jinja template worked for me. See:
#20837 (comment)
adrianhoehne commentedon Apr 18, 2026
I also hit that today with version:
version: 8763 (ff5ef82)
built with GNU 11.4.0 for Linux x86_64
and Qwen 3.6 35B A3B
janvitos commentedon Apr 19, 2026
IDE: Opencode 1.14.18
Model: Qwen3.6 35B A3B IQ4_XS (Bartowski)
Server: llama.cpp b8850
Strangely enough, I encountered the bug twice today even with thinking disabled.
"Assistant response prefill is incompatible with enable_thinking"
gxcreator commentedon Apr 20, 2026
Same,
Parameters:
sebastienroul commentedon Apr 22, 2026
Confirmed : [https://github.com//issues/20861#issuecomment-4106288368] work for us
blockfeed commentedon Apr 28, 2026
+1, same setup as @janvitos (effectively). Will update with details shortly.
jhemmond commentedon Apr 30, 2026
Happens in Qwen3.6-35B as well.
rneilson-cerby commentedon May 13, 2026
Reproduced here too, Qwen3.6-35B-A3B (unsloth).
Request:
{ "model": "qwen3.6-35b-a3b", "messages": [ { "role": "user", "content": "Question: What are the names of the planets in the Solar System?" }, { "role": "assistant", "content": "Answer: " } ] }Response:
{ "error": { "code": 400, "message": "Assistant response prefill is incompatible with enable_thinking.", "type": "invalid_request_error" } }Interestingly, I tried it with Qwen3.5-4B with
{"enable_thinking": false}(to make sure reasoning was off), and the content of the response started with<think>\n\n</think>\n\nas if the template wasn't removing it and wasn't incorporating the assistant prefill.version: 9110 (ef22b3e)
github-actions commentedon Jun 28, 2026
This issue was closed because it has been inactive for 14 days since being marked as stale.