fix(ollama): emit top-level reasoning_effort=none on /v1/chat/completions (#25758) - #64608
Merged
Conversation
…ions (#25758) Ollama's /v1/chat/completions silently ignores extra_body.think (it only honours it on /api/chat — ollama/ollama#14820), so agent.reasoning_effort: none never actually disabled thinking on OpenAI-compatible Ollama routes. Emit the top-level reasoning_effort='none' field (which Ollama respects) alongside think=False (kept for proxies and the native /api/chat path). The PR's second half (propagating reasoning_config to the background-review fork) already landed on main via agent/background_review.py, so only the provider-profile change is salvaged here, resolved onto the current GLM/effort-aware profile. Salvaged from PR #29820 by @Epoxidex.
teknium1
force-pushed
the
salvage/29820-ollama-reasoning
branch
from
July 15, 2026 13:28
47c4606 to
44d20be
Compare
19 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
agent.reasoning_effort: nonenow actually disables thinking on Ollama's OpenAI-compatible endpoint: the custom provider profile emits top-levelreasoning_effort="none"(which Ollama honours) alongsideextra_body.think=False(which/v1/chat/completionssilently ignores — ollama#14820, kept for proxies and the native/api/chatpath). Fixes the runaway-thinking half of #25758, where a thinking-capable local model kept reasoning despitenone— up to 209k chars ofreasoning_content/ 65k output tokens / 28 minutes of GPU decode in the reporter's bg-review spiral.Scope note: the issue's second defect (bg-review fork not inheriting
reasoning_config) is already fixed on main (agent/background_review.pypropagates it in_fork_kwargs), so only the provider-profile half is salvaged, resolved onto the current GLM/effort-aware profile that landed after the PR was opened.Changes
plugins/model-providers/custom/__init__.py: disable path emitsreasoning_effort="none"top-level +think=False; enabled+effort path unchanged.tests/plugins/model_providers/test_custom_profile.py: disable-path tests assert the dual emission; GLM effort passthrough coverage unchanged.Validation
reasoning_effort: noneon Ollama /v1think:falsesent → model thinks anywayreasoning_effort:"none"sent (honoured) +think:falseSalvages #29820 by @Epoxidex (authorship preserved; conflict-resolved onto the newer effort-aware profile). Fixes the remaining half of #25758 (reporter's own validation table shows 0 reasoning chars / 88s vs 28 min after both fixes).
Infographic