[GH-ISSUE #10976] Thinking + tools + qwen3 = empty output #32993

Open
opened 2026-04-22 15:04:15 -05:00 by GiteaMirror · 6 comments
Owner

Originally created by @du291 on GitHub (Jun 5, 2025).
Original GitHub issue: https://github.com/ollama/ollama/issues/10976

Originally assigned to: @drifkin on GitHub.

What is the issue?

Passing tool definitions as well as think=true via the api generates empty output. I remember this used to work in previous versions. One could argue that one might not be interested in 'thoughts' when using tool calls, but the model may output qualitatively different answers with think=true.

Relevant log output

POST /api/chat HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate, zstd
Connection: keep-alive
Content-Length: 257
Content-Type: application/json
Host: 127.0.0.1:11434
User-Agent: HTTPie/3.2.4

{
    "format": "json",
    "messages": [
        {
            "content": "press the button",
            "role": "user"
        }
    ],
    "model": "qwen3:30b-a3b",
    "stream": false,
    "think": true,
    "tools": [
        {
            "function": {
                "description": "press the button",
                "name": "press_button",
                "parameters": {
                    "type": "object"
                }
            },
            "type": "function"
        }
    ]
}


HTTP/1.1 200 OK
Content-Length: 301
Content-Type: application/json; charset=utf-8
Date: Thu, 05 Jun 2025 09:03:21 GMT

{
    "created_at": "2025-06-05T09:03:21.250431434Z",
    "done": true,
    "done_reason": "stop",
    "eval_count": 29,
    "eval_duration": 1482226859,
    "load_duration": 13063588,
    "message": {
        "content": "",
        "role": "assistant"
    },
    "model": "qwen3:30b-a3b",
    "prompt_eval_count": 131,
    "prompt_eval_duration": 128174504,
    "total_duration": 1624041007
}


Without thinking:

POST /api/chat HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate, zstd
Connection: keep-alive
Content-Length: 258
Content-Type: application/json
Host: 127.0.0.1:11434
User-Agent: HTTPie/3.2.4

{
    "format": "json",
    "messages": [
        {
            "content": "press the button",
            "role": "user"
        }
    ],
    "model": "qwen3:30b-a3b",
    "stream": false,
    "think": false,
    "tools": [
        {
            "function": {
                "description": "press the button",
                "name": "press_button",
                "parameters": {
                    "type": "object"
                }
            },
            "type": "function"
        }
    ]
}


HTTP/1.1 200 OK
Content-Length: 370
Content-Type: application/json; charset=utf-8
Date: Thu, 05 Jun 2025 09:02:06 GMT

{
    "created_at": "2025-06-05T09:02:06.187260157Z",
    "done": true,
    "done_reason": "stop",
    "eval_count": 13,
    "eval_duration": 573353215,
    "load_duration": 1688824382,
    "message": {
        "content": "",
        "role": "assistant",
        "tool_calls": [
            {
                "function": {
                    "arguments": {},
                    "name": "press_button"
                }
            }
        ]
    },
    "model": "qwen3:30b-a3b",
    "prompt_eval_count": 137,
    "prompt_eval_duration": 1224210867,
    "total_duration": 3488203248
}

OS

Linux

GPU

Nvidia

CPU

AMD

Ollama version

0.9.0

Originally created by @du291 on GitHub (Jun 5, 2025). Original GitHub issue: https://github.com/ollama/ollama/issues/10976 Originally assigned to: @drifkin on GitHub. ### What is the issue? Passing tool definitions as well as think=true via the api generates empty output. I remember this used to work in previous versions. One could argue that one might not be interested in 'thoughts' when using tool calls, but the model may output qualitatively different answers with think=true. ### Relevant log output ```shell POST /api/chat HTTP/1.1 Accept: application/json, */*;q=0.5 Accept-Encoding: gzip, deflate, zstd Connection: keep-alive Content-Length: 257 Content-Type: application/json Host: 127.0.0.1:11434 User-Agent: HTTPie/3.2.4 { "format": "json", "messages": [ { "content": "press the button", "role": "user" } ], "model": "qwen3:30b-a3b", "stream": false, "think": true, "tools": [ { "function": { "description": "press the button", "name": "press_button", "parameters": { "type": "object" } }, "type": "function" } ] } HTTP/1.1 200 OK Content-Length: 301 Content-Type: application/json; charset=utf-8 Date: Thu, 05 Jun 2025 09:03:21 GMT { "created_at": "2025-06-05T09:03:21.250431434Z", "done": true, "done_reason": "stop", "eval_count": 29, "eval_duration": 1482226859, "load_duration": 13063588, "message": { "content": "", "role": "assistant" }, "model": "qwen3:30b-a3b", "prompt_eval_count": 131, "prompt_eval_duration": 128174504, "total_duration": 1624041007 } Without thinking: POST /api/chat HTTP/1.1 Accept: application/json, */*;q=0.5 Accept-Encoding: gzip, deflate, zstd Connection: keep-alive Content-Length: 258 Content-Type: application/json Host: 127.0.0.1:11434 User-Agent: HTTPie/3.2.4 { "format": "json", "messages": [ { "content": "press the button", "role": "user" } ], "model": "qwen3:30b-a3b", "stream": false, "think": false, "tools": [ { "function": { "description": "press the button", "name": "press_button", "parameters": { "type": "object" } }, "type": "function" } ] } HTTP/1.1 200 OK Content-Length: 370 Content-Type: application/json; charset=utf-8 Date: Thu, 05 Jun 2025 09:02:06 GMT { "created_at": "2025-06-05T09:02:06.187260157Z", "done": true, "done_reason": "stop", "eval_count": 13, "eval_duration": 573353215, "load_duration": 1688824382, "message": { "content": "", "role": "assistant", "tool_calls": [ { "function": { "arguments": {}, "name": "press_button" } } ] }, "model": "qwen3:30b-a3b", "prompt_eval_count": 137, "prompt_eval_duration": 1224210867, "total_duration": 3488203248 } ``` ### OS Linux ### GPU Nvidia ### CPU AMD ### Ollama version 0.9.0
GiteaMirror added the toolsthinkingbug labels 2026-04-22 15:04:15 -05:00
Author
Owner

@du291 commented on GitHub (Jun 5, 2025):

Addendum: actually the api response seems to NOT work properly with think=true even without tools. I'd expect thoughts to be in 'thoughts' and 'message' to contain the answer. It appears that message contains the thoughts and answer is nowhere to be found.

POST /api/chat HTTP/1.1
Accept: application/json, */*;q=0.5
Accept-Encoding: gzip, deflate, zstd
Connection: keep-alive
Content-Length: 128
Content-Type: application/json
Host: 127.0.0.1:11434
User-Agent: HTTPie/3.2.4

{
    "format": "json",
    "messages": [
        {
            "content": "press the button",
            "role": "user"
        }
    ],
    "model": "qwen3:30b-a3b",
    "stream": false,
    "think": true
}


HTTP/1.1 200 OK
Content-Length: 929
Content-Type: application/json; charset=utf-8
Date: Thu, 05 Jun 2025 09:06:29 GMT

{
    "created_at": "2025-06-05T09:06:29.494231479Z",
    "done": true,
    "done_reason": "stop",
    "eval_count": 134,
    "eval_duration": 6380232883,
    "load_duration": 11967477,
    "message": {
        "content": "{\"{\"role\": \"assistant\", \"content\": \"Okay, the user just said 'press the button'. I need to respond appropriately. Let me think about the context. They might be referring to a physical button, like on a device or a website. But since I can't interact with physical objects, I should clarify. Maybe they want me to simulate pressing a button in a conversation. Alternatively, they could be testing my response. I should ask for more details to understand what they need. Let me make sure to keep the response friendly and helpful. I'll prompt them to explain what they mean by 'press the button' so I can assist better.\"}",
        "role": "assistant"
    },
    "model": "qwen3:30b-a3b",
    "prompt_eval_count": 13,
    "prompt_eval_duration": 196221601,
    "total_duration": 6589302570
}

I don't know how this is possible when the command line works just fine. Maybe due to streaming?

$ echo 'press the button'|ollama run qwen3:30b-a3b
Thinking...
Okay, the user said "press the button." I need to figure out how to respond. First, I should check if there's a specific button they're 
referring to. Since I can't interact with physical buttons, maybe they're talking about a virtual one. But the user might just be testing me 
or trying to see if I can handle commands. I should acknowledge their request and explain that I can't press a physical button. Then, offer 
help with something else. Let me make sure my response is friendly and helpful. Maybe say something like, "I can't press physical buttons, 
but I can help you with anything else. What do you need?" That should cover it.
...done thinking.

I can't press physical buttons, but I'm here to help you with anything else! What would you like assistance with? 😊
<!-- gh-comment-id:2943370837 --> @du291 commented on GitHub (Jun 5, 2025): Addendum: actually the api response seems to NOT work properly with think=true even without tools. I'd expect thoughts to be in 'thoughts' and 'message' to contain the answer. It appears that message contains the thoughts and answer is nowhere to be found. ``` POST /api/chat HTTP/1.1 Accept: application/json, */*;q=0.5 Accept-Encoding: gzip, deflate, zstd Connection: keep-alive Content-Length: 128 Content-Type: application/json Host: 127.0.0.1:11434 User-Agent: HTTPie/3.2.4 { "format": "json", "messages": [ { "content": "press the button", "role": "user" } ], "model": "qwen3:30b-a3b", "stream": false, "think": true } HTTP/1.1 200 OK Content-Length: 929 Content-Type: application/json; charset=utf-8 Date: Thu, 05 Jun 2025 09:06:29 GMT { "created_at": "2025-06-05T09:06:29.494231479Z", "done": true, "done_reason": "stop", "eval_count": 134, "eval_duration": 6380232883, "load_duration": 11967477, "message": { "content": "{\"{\"role\": \"assistant\", \"content\": \"Okay, the user just said 'press the button'. I need to respond appropriately. Let me think about the context. They might be referring to a physical button, like on a device or a website. But since I can't interact with physical objects, I should clarify. Maybe they want me to simulate pressing a button in a conversation. Alternatively, they could be testing my response. I should ask for more details to understand what they need. Let me make sure to keep the response friendly and helpful. I'll prompt them to explain what they mean by 'press the button' so I can assist better.\"}", "role": "assistant" }, "model": "qwen3:30b-a3b", "prompt_eval_count": 13, "prompt_eval_duration": 196221601, "total_duration": 6589302570 } ``` I don't know how this is possible when the command line works just fine. Maybe due to streaming? ``` $ echo 'press the button'|ollama run qwen3:30b-a3b Thinking... Okay, the user said "press the button." I need to figure out how to respond. First, I should check if there's a specific button they're referring to. Since I can't interact with physical buttons, maybe they're talking about a virtual one. But the user might just be testing me or trying to see if I can handle commands. I should acknowledge their request and explain that I can't press a physical button. Then, offer help with something else. Let me make sure my response is friendly and helpful. Maybe say something like, "I can't press physical buttons, but I can help you with anything else. What do you need?" That should cover it. ...done thinking. I can't press physical buttons, but I'm here to help you with anything else! What would you like assistance with? 😊 ```
Author
Owner

@rick-github commented on GitHub (Jun 5, 2025):

#10929

<!-- gh-comment-id:2943434143 --> @rick-github commented on GitHub (Jun 5, 2025): #10929
Author
Owner

@tutman96 commented on GitHub (Jul 6, 2025):

I ran into this issue today as well. I don't use structured outputs and it got stuck in a loop calling a tool, almost as if the tool messages weren't templated in correctly. Haven't dug into it yet, but in my case the tool call worked, it just didn't go to the next step of spitting out assistant responses.

<!-- gh-comment-id:3042933290 --> @tutman96 commented on GitHub (Jul 6, 2025): I ran into this issue today as well. I don't use structured outputs and it got stuck in a loop calling a tool, almost as if the tool messages weren't templated in correctly. Haven't dug into it yet, but in my case the tool call worked, it just didn't go to the next step of spitting out assistant responses.
Author
Owner

@jverkoey commented on GitHub (Dec 30, 2025):

Also ran into this today sadly. Going to try disabling thinking when using tool calls.

<!-- gh-comment-id:3700267910 --> @jverkoey commented on GitHub (Dec 30, 2025): Also ran into this today sadly. Going to try disabling thinking when using tool calls.
Author
Owner

@mattmikul commented on GitHub (Jan 3, 2026):

I ran in to this but from a different angle - with or without the think option I was getting only {} responses from Qwen 3 14b when I wanted structured JSON responses. (other models were working fine)

In my case I narrowed it down to the "format": "json" option - without that, things work as I was expecting.

<!-- gh-comment-id:3706691661 --> @mattmikul commented on GitHub (Jan 3, 2026): I ran in to this but from a different angle - with or without the `think` option I was getting only `{}` responses from Qwen 3 14b when I wanted structured JSON responses. (other models were working fine) In my case I narrowed it down to the `"format": "json"` option - _without_ that, things work as I was expecting.
Author
Owner

@oggixx commented on GitHub (Mar 8, 2026):

🦀 Confirming this issue from OpenClaw users:

We're experiencing the exact same problem with Qwen 3.5:

  • Thinking mode enabled
  • Tools defined in request
  • Model returns empty output or endless repetition
  • No tool calls executed

Our Setup:

  • OpenClaw framework with tool-calling agents
  • ollama/qwen3.5:397b-cloud
  • Thinking + Tools combination

Impact:
This blocks us from using Qwen 3.5 for complex agent workflows that require both reasoning (thinking) and tool execution.

Fallback:
We've switched to Minimax M2.5 for thinking+tools workflows, but Qwen 3.5 has better overall capabilities.

Related Issues:

  • #14493 (Qwen 3.5 tool calling non-functional)
  • #14601 (malformed tool definitions)
  • #14603 (fix merged 2026-03-04)

Is there a known workaround or ETA for a fix? This is a production blocker for us.

Thanks for the great work on Ollama! 🙏

<!-- gh-comment-id:4019070674 --> @oggixx commented on GitHub (Mar 8, 2026): 🦀 Confirming this issue from OpenClaw users: We're experiencing the exact same problem with Qwen 3.5: - Thinking mode enabled - Tools defined in request - Model returns empty output or endless repetition - No tool calls executed **Our Setup:** - OpenClaw framework with tool-calling agents - `ollama/qwen3.5:397b-cloud` - Thinking + Tools combination **Impact:** This blocks us from using Qwen 3.5 for complex agent workflows that require both reasoning (thinking) and tool execution. **Fallback:** We've switched to Minimax M2.5 for thinking+tools workflows, but Qwen 3.5 has better overall capabilities. **Related Issues:** - #14493 (Qwen 3.5 tool calling non-functional) - #14601 (malformed tool definitions) - #14603 (fix merged 2026-03-04) Is there a known workaround or ETA for a fix? This is a production blocker for us. Thanks for the great work on Ollama! 🙏
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#32993