ollama - ✅(Solved) Fix qwen3.5:9b sometimes prints out tool call instead of executing it [1 pull requests, 12 comments, 8 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
ollama/ollama#14745Fetched 2026-04-08 00:32:12
View on GitHub
Comments
12
Participants
8
Timeline
32
Reactions
9
Author
Assignees
Timeline (top)
subscribed ×14commented ×12cross-referenced ×3assigned ×1

Fix Action

Fix / Workaround

workaround: use ollama 0.17.5

PR fix notes

PR #15022: model/parsers: Close think block if tool block starts in Qwen3.5

Description (problem / solution / changelog)

This change fixes https://github.com/ollama/ollama/issues/14745 when the model starts a tool_call block without closing the think block:

Thinking: I need to mock Valkey for tests. Let me check how the app initializes Valkey and update TESTING.md with this information.
<tool_call>
<function=bash>
<parameter=command>
grep "redacted" | head -20
</parameter>
<parameter=description>
Find Valkey initialization
</parameter>
</function>
</tool_call>

I saw this behavior while using Opencode + Ollama 0.18.2 + qwen3.5:9b. I have been working for a couple of days with the same setup and this patch without problems.

Issues that can be fixed with this PR as well:

external:

Regards, and thank you all for this great tool.

Changed files

  • model/parsers/qwen35.go (modified, +9/-0)
  • model/parsers/qwen35_test.go (modified, +14/-8)

Code Example

Thinking: I need to mock Valkey for tests. Let me check how the app initializes Valkey and update TESTING.md with this information.
<tool_call>
<function=bash>
<parameter=command>
grep "redacted" | head -20
</parameter>
<parameter=description>
Find Valkey initialization
</parameter>
</function>
</tool_call>

---

$ ollama ls
NAME          ID              SIZE      MODIFIED     
qwen3.5:9b    6488c96fa5fa    6.6 GB    25 hours ago

---

$ ollama show qwen3.5:9b
  Model
    architecture        qwen35    
    parameters          9.7B      
    context length      262144    
    embedding length    4096      
    quantization        Q4_K_M    
    requires            0.17.1    

  Capabilities
    completion    
    vision        
    tools         
    thinking      

  Parameters
    presence_penalty    1.5     
    temperature         1       
    top_k               20      
    top_p               0.95    

  License
    Apache License               
    Version 2.0, January 2004    
    ...

---

$ ollama show --modelfile qwen3.5:9b
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this, replace FROM with:
# FROM qwen3.5:9b

FROM /usr/share/ollama/.ollama/models/blobs/sha256-dec52a44569a2a25341c4e4d3fee25846eed4f6f0b936278e3a3c900bb99d37c
TEMPLATE {{ .Prompt }}
RENDERER qwen3.5
PARSER qwen3.5
PARAMETER temperature 1
PARAMETER top_k 20
PARAMETER top_p 0.95
PARAMETER presence_penalty 1.5

---
RAW_BUFFERClick to expand / collapse

workaround: use ollama 0.17.5

What is the issue?

Using the model from ollama.com and Opencode 1.2.24. This happens fairly often and halts the work the agent was doing.

Thinking: I need to mock Valkey for tests. Let me check how the app initializes Valkey and update TESTING.md with this information.
<tool_call>
<function=bash>
<parameter=command>
grep "redacted" | head -20
</parameter>
<parameter=description>
Find Valkey initialization
</parameter>
</function>
</tool_call>
$ ollama ls
NAME          ID              SIZE      MODIFIED     
qwen3.5:9b    6488c96fa5fa    6.6 GB    25 hours ago
$ ollama show qwen3.5:9b
  Model
    architecture        qwen35    
    parameters          9.7B      
    context length      262144    
    embedding length    4096      
    quantization        Q4_K_M    
    requires            0.17.1    

  Capabilities
    completion    
    vision        
    tools         
    thinking      

  Parameters
    presence_penalty    1.5     
    temperature         1       
    top_k               20      
    top_p               0.95    

  License
    Apache License               
    Version 2.0, January 2004    
    ...
$ ollama show --modelfile qwen3.5:9b
# Modelfile generated by "ollama show"
# To build a new Modelfile based on this, replace FROM with:
# FROM qwen3.5:9b

FROM /usr/share/ollama/.ollama/models/blobs/sha256-dec52a44569a2a25341c4e4d3fee25846eed4f6f0b936278e3a3c900bb99d37c
TEMPLATE {{ .Prompt }}
RENDERER qwen3.5
PARSER qwen3.5
PARAMETER temperature 1
PARAMETER top_k 20
PARAMETER top_p 0.95
PARAMETER presence_penalty 1.5

Relevant log output

OS

Linux

GPU

AMD

CPU

AMD

Ollama version

0.17.7

extent analysis

Fix Plan

To resolve the issue, we will downgrade the Ollama version to 0.17.5 as suggested in the workaround.

Steps:

  • Stop any ongoing Ollama processes
  • Uninstall the current Ollama version (0.17.7)
  • Install Ollama version 0.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

ollama - ✅(Solved) Fix qwen3.5:9b sometimes prints out tool call instead of executing it [1 pull requests, 12 comments, 8 participants]