Skip to content

fix(ollama): emit top-level reasoning_effort=none on /v1/chat/completions (#25758) - #64608

Merged
teknium1 merged 2 commits into
mainfrom
salvage/29820-ollama-reasoning
Jul 15, 2026
Merged

fix(ollama): emit top-level reasoning_effort=none on /v1/chat/completions (#25758)#64608
teknium1 merged 2 commits into
mainfrom
salvage/29820-ollama-reasoning

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

agent.reasoning_effort: none now actually disables thinking on Ollama's OpenAI-compatible endpoint: the custom provider profile emits top-level reasoning_effort="none" (which Ollama honours) alongside extra_body.think=False (which /v1/chat/completions silently ignores — ollama#14820, kept for proxies and the native /api/chat path). Fixes the runaway-thinking half of #25758, where a thinking-capable local model kept reasoning despite none — up to 209k chars of reasoning_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.py propagates 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 emits reasoning_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

Before After
reasoning_effort: none on Ollama /v1 only ignored think:false sent → model thinks anyway reasoning_effort:"none" sent (honoured) + think:false
tests/plugins/model_providers/test_custom_profile.py 13/13 pass

Salvages #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

ollama-reasoning

@alt-glitch alt-glitch added type/bug Something isn't working comp/plugins Plugin system and bundled plugins provider/ollama Ollama / local models P3 Low — cosmetic, nice to have labels Jul 14, 2026
Epoxidex and others added 2 commits July 15, 2026 06:25
…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
teknium1 force-pushed the salvage/29820-ollama-reasoning branch from 47c4606 to 44d20be Compare July 15, 2026 13:28
@teknium1
teknium1 merged commit 306e2d2 into main Jul 15, 2026
31 checks passed
@teknium1
teknium1 deleted the salvage/29820-ollama-reasoning branch July 15, 2026 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have provider/ollama Ollama / local models type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants