Skip to content

[codex] Respect explicit Ollama think setting - #4

Draft
TheEditor wants to merge 1 commit into
GuideboardLabs:mainfrom
Ozhiaki:codex/respect-explicit-ollama-think
Draft

[codex] Respect explicit Ollama think setting#4
TheEditor wants to merge 1 commit into
GuideboardLabs:mainfrom
Ozhiaki:codex/respect-explicit-ollama-think

Conversation

@TheEditor

Copy link
Copy Markdown
Contributor

Summary

Respects explicit think settings passed to OllamaClient.chat() while preserving the current default behavior for reasoning models.

When callers omit think, reasoning models such as qwen3 and deepseek-r1 still default to think=true. When callers pass think=false or think=true, that explicit value is now forwarded unchanged to Ollama.

Why

Some bounded calls deliberately disable reasoning, especially smoke tests, exact-answer probes, routing checks, and short command-style requests. The previous behavior overrode think=false for reasoning models, which could consume a small num_predict budget on hidden reasoning and return no visible streamed content.

This keeps the reasoning-model default intact while allowing callers to opt out when the call shape requires it.

Changes

  • Only auto-enable think=true for reasoning models when think is omitted.
  • Preserve explicit think=false for reasoning models.
  • Preserve explicit think=true for non-reasoning models.
  • Add tests covering the default and explicit override behavior.

Validation

  • PYTHONPATH=SourceCode python3 -m unittest tests.test_ollama_wait_for_available tests.test_ollama_stream_watchdog tests.test_inference_router_compat
  • Live local deployment smoke: qwen3:14b through InferenceRouter with think=false, num_predict=48, and num_ctx=8192 returned visible content instead of empty streamed content.
  • git diff --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant