[PR #15901] server: apply format constraint for all thinking parsers when think=false #77644

Open
opened 2026-05-05 10:19:15 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15901
Author: @ArkaD171717
Created: 4/30/2026
Status: 🔄 Open

Base: mainHead: fix/think-false-format-all-parsers


📝 Commits (1)

  • f039237 server: apply format constraint for all thinking parsers when think=false

📊 Changes

2 files changed (+113 additions, -112 deletions)

View changed files

📝 server/routes.go (+1 -3)
📝 server/routes_generate_test.go (+112 -109)

📄 Description

Summary

PR #15678 fixed format being ignored with think=false for gemma4 and
left a TODO to extend to other models. This does that -- replaces the
hardcoded m.Config.Parser == "gemma4" check with
builtinParser.HasThinkingSupport() so it covers qwen3.5, qwen3-thinking,
and everything else automatically.

The test is converted from gemma4-only to table-driven (gemma4, qwen3.5,
qwen3-thinking).

Fixes #14645
Supersedes #14660 (stale, has merge conflicts) and #14923 (inactive)


🔄 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/15901 **Author:** [@ArkaD171717](https://github.com/ArkaD171717) **Created:** 4/30/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/think-false-format-all-parsers` --- ### 📝 Commits (1) - [`f039237`](https://github.com/ollama/ollama/commit/f0392377da8c28f531ee3738c161d62c8c33b905) server: apply format constraint for all thinking parsers when think=false ### 📊 Changes **2 files changed** (+113 additions, -112 deletions) <details> <summary>View changed files</summary> 📝 `server/routes.go` (+1 -3) 📝 `server/routes_generate_test.go` (+112 -109) </details> ### 📄 Description ## Summary PR #15678 fixed format being ignored with `think=false` for gemma4 and left a TODO to extend to other models. This does that -- replaces the hardcoded `m.Config.Parser == "gemma4"` check with `builtinParser.HasThinkingSupport()` so it covers qwen3.5, qwen3-thinking, and everything else automatically. The test is converted from gemma4-only to table-driven (gemma4, qwen3.5, qwen3-thinking). Fixes #14645 Supersedes #14660 (stale, has merge conflicts) and #14923 (inactive) --- <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-05-05 10:19:15 -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#77644