Skip to content

fix: only send think=false to Ollama, not all custom providers#11520

Open
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix-think-ollama-only
Open

fix: only send think=false to Ollama, not all custom providers#11520
vominh1919 wants to merge 1 commit into
NousResearch:mainfrom
vominh1919:fix-think-ollama-only

Conversation

@vominh1919

Copy link
Copy Markdown
Contributor

Problem

When reasoning_effort: none is set, Hermes sends extra_body["think"] = false to every custom provider endpoint. The think parameter is Ollama-specific and is rejected with HTTP 422 by non-Ollama providers (Mistral, Fireworks, Together.ai, vLLM).

Fix

Gate think=false behind Ollama detection using the same pattern as _is_ollama_glm_backend():

  • self._ollama_num_ctx is set (auto-detected Ollama)
  • OR base_url contains ollama
  • OR base_url contains :11434 (Ollama default port)

Fixes #11237

The `think` parameter is Ollama-specific. Sending it to other custom
providers (Mistral, Fireworks, Together.ai, vLLM) causes HTTP 422.
Fix: gate behind Ollama detection.
Fixes NousResearch#11237
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder provider/ollama Ollama / local models labels Apr 24, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Competing fix with #12914 for #11237 — both scope think=False to Ollama endpoints only. This PR uses _is_ollama_glm_backend() pattern, #12914 may differ in detection approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/ollama Ollama / local models type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: think=False incorrectly sent to all provider=custom endpoints, not just Ollama

2 participants