[codex] Respect explicit Ollama think setting - #4
Draft
TheEditor wants to merge 1 commit into
Draft
Conversation
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
Respects explicit
thinksettings passed toOllamaClient.chat()while preserving the current default behavior for reasoning models.When callers omit
think, reasoning models such asqwen3anddeepseek-r1still default tothink=true. When callers passthink=falseorthink=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=falsefor reasoning models, which could consume a smallnum_predictbudget 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
think=truefor reasoning models whenthinkis omitted.think=falsefor reasoning models.think=truefor non-reasoning models.Validation
PYTHONPATH=SourceCode python3 -m unittest tests.test_ollama_wait_for_available tests.test_ollama_stream_watchdog tests.test_inference_router_compatqwen3:14bthroughInferenceRouterwiththink=false,num_predict=48, andnum_ctx=8192returned visible content instead of empty streamed content.git diff --check