[PR #14477] [MERGED] model: fix parsing qwen3 tool calling in thinking #40572

Closed
opened 2026-04-23 01:26:31 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/14477
Author: @jmorganca
Created: 2/26/2026
Status: Merged
Merged: 2/27/2026
Merged by: @jmorganca

Base: mainHead: jmorganca/qwen3-thinking-parser


📝 Commits (1)

  • fb4f345 model: fix qwen3 tool calling in thinking

📊 Changes

4 files changed (+114 additions, -16 deletions)

View changed files

📝 model/parsers/qwen3.go (+19 -1)
📝 model/parsers/qwen3_test.go (+62 -0)
📝 model/parsers/qwen3vl.go (+24 -9)
📝 model/parsers/qwen3vl_thinking_test.go (+9 -6)

📄 Description

Align Qwen parser behavior with Transformers serve by allowing <tool_call> parsing while still in thinking collection.

Changes:

  • qwen3vl: detect <tool_call> before in thinking state and transition to tool parsing

  • qwen3: same thinking-state tool detection and partial-tag overlap handling

  • tests: update qwen3vl thinking/tool interleaving expectations

  • tests: add qwen3 cases for tool call before and split <tool_call> streaming


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/14477 **Author:** [@jmorganca](https://github.com/jmorganca) **Created:** 2/26/2026 **Status:** ✅ Merged **Merged:** 2/27/2026 **Merged by:** [@jmorganca](https://github.com/jmorganca) **Base:** `main` ← **Head:** `jmorganca/qwen3-thinking-parser` --- ### 📝 Commits (1) - [`fb4f345`](https://github.com/ollama/ollama/commit/fb4f3459ba1b3e318d0061d02f628c219c00fa25) model: fix qwen3 tool calling in thinking ### 📊 Changes **4 files changed** (+114 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `model/parsers/qwen3.go` (+19 -1) 📝 `model/parsers/qwen3_test.go` (+62 -0) 📝 `model/parsers/qwen3vl.go` (+24 -9) 📝 `model/parsers/qwen3vl_thinking_test.go` (+9 -6) </details> ### 📄 Description Align Qwen parser behavior with Transformers serve by allowing <tool_call> parsing while still in thinking collection. Changes: - qwen3vl: detect <tool_call> before </think> in thinking state and transition to tool parsing - qwen3: same thinking-state tool detection and partial-tag overlap handling - tests: update qwen3vl thinking/tool interleaving expectations - tests: add qwen3 cases for tool call before </think> and split <tool_call> streaming --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-23 01:26:31 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#40572