Skip to content

Misc. bug: Qwen3.5 with Opencode: Assistant response prefill is incompatible with enable_thinking. #20861

Closed as not planned

Description

@alefranz

Name and Version

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"}}

Activity

  1. github-actions commented on Mar 22, 2026

    @github-actions
    Contributor

    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

  2. UltraRabbit commented on Mar 22, 2026

    @UltraRabbit

    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.

  3. joshvoigts commented on Apr 4, 2026

    @joshvoigts

    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.

  4. marciowb commented on Apr 16, 2026

    @marciowb

    Using a custom Jinja template worked for me. See:
    #20837 (comment)

  5. adrianhoehne commented on Apr 18, 2026

    @adrianhoehne

    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

  6. janvitos commented on Apr 19, 2026

    @janvitos

    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"

  7. gxcreator commented on Apr 20, 2026

    @gxcreator

    Same,

     {"error":{"code":400,"message":"Assistant response prefill is incompatible with enable_thinking.","type":"invalid_request_error"}}
    
    

    Parameters:

    llama-server --hf-repo unsloth/Qwen3.6-35B-A3B-GGUF:Q6_K_XL --host 0.0.0.0 --port 11434 --ctx-size 256000 --temp 0.6 --top-p 0.95 --top-k 20 --min-p 0.00
    
  8. sebastienroul commented on Apr 22, 2026

    @sebastienroul

    Confirmed : [https://github.com//issues/20861#issuecomment-4106288368] work for us

  9. blockfeed commented on Apr 28, 2026

    @blockfeed

    +1, same setup as @janvitos (effectively). Will update with details shortly.

  10. jhemmond commented on Apr 30, 2026

    @jhemmond

    Happens in Qwen3.6-35B as well.

  11. rneilson-cerby commented on May 13, 2026

    @rneilson-cerby

    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\n as if the template wasn't removing it and wasn't incorporating the assistant prefill.

    version: 9110 (ef22b3e)

  12. github-actions commented on Jun 28, 2026

    @github-actions
    Contributor

    This issue was closed because it has been inactive for 14 days since being marked as stale.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions