Skip to content

fix: restrict think=False to Ollama endpoints only#12488

Open
Sanjays2402 wants to merge 1 commit into
NousResearch:mainfrom
Sanjays2402:fix/think-false-ollama-only-11237
Open

fix: restrict think=False to Ollama endpoints only#12488
Sanjays2402 wants to merge 1 commit into
NousResearch:mainfrom
Sanjays2402:fix/think-false-ollama-only-11237

Conversation

@Sanjays2402

@Sanjays2402 Sanjays2402 commented Apr 19, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

think=False was being sent to ALL custom provider endpoints when reasoning was disabled, not just Ollama. This could cause errors with non-Ollama custom endpoints that don't recognize the think parameter.

Fix: added an Ollama endpoint check before setting think=False. The condition now verifies the base URL contains ollama or uses port 11434 (Ollama's default port). For any other custom endpoint, think=False is no longer injected into the request.

Related Issue

Fixes #11237

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)

Changes Made

  • Reasoning-disabled path now gates the think=False injection on "is this an Ollama endpoint?" (URL substring ollama or port 11434) before adding the parameter.

How to Test

  1. Configure a non-Ollama custom endpoint (e.g. a local vLLM or llama.cpp server).
  2. Disable reasoning in the request.
  3. Before: the provider rejects with an unknown-parameter error. After: request succeeds; think is not sent.
  4. Configure an Ollama endpoint (e.g. http://localhost:11434) with reasoning disabled and confirm think=False is still sent (no regression).

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix:)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes — covered by endpoint-detection path
  • I've tested on my platform: macOS 26.5 (arm64)

Documentation & Housekeeping

  • Documentation updates — N/A
  • cli-config.yaml.example — N/A
  • CONTRIBUTING.md / AGENTS.md — N/A
  • Cross-platform impact considered — URL string check only
  • Tool descriptions/schemas — N/A

Screenshots / Logs

N/A — parameter-gating fix.

Previously, think=False was sent to ALL custom provider endpoints when
reasoning was disabled. Now it only applies when the base_url contains
'ollama' or uses port 11434 (Ollama's default).
@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 22, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Likely duplicate of #11362 — both fix the same issue (#11237) by gating think=False on Ollama endpoint detection.

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