Repository navigation
Description
Summary
Running a local ollama thinking-model (gemma3 / "gemma4", qwen3, etc.) through the default @ai-sdk/openai-compatible provider, there is no ergonomic/discoverable way to disable the model's thinking. ollama's /v1/chat/completions only turns thinking off when the request body contains reasoning_effort: "none" (refs: ollama/ollama#14820, ollama/ollama#12004). The CLI sends that field only if the user sets the exact camelCase reasoningEffort option; every other natural attempt silently no-ops, and the run then hangs / returns empty content because the model spends its budget in the hidden reasoning channel.
Impact
Thinking-capable ollama models are effectively unusable for structured-output tasks (e.g. code review) via the CLI unless the user happens to know the exact camelCase key. Symptom: aictrl run produces empty output / appears to hang (130–240 s, no result).
What works / what doesn't (measured: gemma 12B @ local ollama, openai-compatible provider → http://localhost:11434/v1)
model options / flag |
result |
|---|---|
{ "reasoningEffort": "none" } (camelCase) |
✅ thinking off, real output, ~14 s |
{ "reasoning_effort": "none" } (snake_case) |
❌ silently dropped → thinking on → empty content |
{ "think": false } / { "reasoning": false } / { "thinking": {"type":"disabled"} } |
❌ not /v1 fields → ignored |
--variant none / --variant minimal |
❌ no such variant for openai-compatible |
Raw curl /v1/chat/completions with reasoning_effort:"none" confirms ollama honours it (real content, empty reasoning), so the gap is purely on the CLI side.
Root cause (traced in packages/cli/src/provider/)
- snake_case silently dropped, then overwritten with
undefined. The options schema declares only camelCasereasoningEffort(sdk/copilot/chat/openai-compatible-chat-options.ts:15), so snake_casereasoning_effortis stripped byparseProviderOptions. The body builder then unconditionally setsreasoning_effort: compatibleOptions.reasoningEffort(sdk/copilot/chat/openai-compatible-chat-language-model.ts:175), overwriting any spread snake_case value withundefined(dropped byJSON.stringify). - No
none/minimalvariant for@ai-sdk/openai-compatible.ProviderTransform.variants()(transform.ts:~467) emits onlylow/medium/high(WIDELY_SUPPORTED_EFFORTS) for this provider, and only whencapabilities.reasoning === true. So--variant noneresolves to{}(no-op).OPENAI_EFFORTS(which already includesnone/minimal) is defined nearby but unused for this provider. - Robustness: with thinking left on, ollama returns a
reasoningfield that the upstream openai-compatible handling chokes on (Bug: OpenAI-compatible provider rejects Ollama'sreasoningfield, causing infinite spin/hang anomalyco/opencode#21903) → spin/empty instead of a clear error.
Proposed fix
- A (primary): accept snake_case and prefer it — add
reasoning_efforttoopenaiCompatibleProviderOptions, and atopenai-compatible-chat-language-model.ts:175use
reasoning_effort: compatibleOptions.reasoning_effort ?? compatibleOptions.reasoningEffort. - B: populate
none/minimalvariants for@ai-sdk/openai-compatible(useOPENAI_EFFORTSattransform.ts:~467) so--variant noneworks; don't requirecapabilities.reasoning:truejust to expose a "disable" variant. - C (docs): document
reasoningEffort: "none"as the way to disable thinking for ollama models.
Workaround
Set "reasoningEffort": "none" (camelCase) in the model's options in the provider config.
Refs
- Document
reasoning_effortsupport in OpenAI-compatible/v1/chat/completionsAPI ollama/ollama#14820 — documentreasoning_efforton/v1 - Chat completion API throws errors for reasoning_effort set to false (gpt-oss) and 'minimal' level is not supported ollama/ollama#12004 —
reasoning_effort:falseerrors,minimalunsupported,nonedisables - Bug: OpenAI-compatible provider rejects Ollama's
reasoningfield, causing infinite spin/hang anomalyco/opencode#21903 — hang on ollamareasoningfield - [Bug]: reasoning.effort not forwarded to Ollama — only minimal thinking despite thinking=high openclaw/openclaw#13575, #33272 — reasoning effort not forwarded / sent to unsupported endpoints
Filed from the skill-md-research cr-local-kg experiment (local-model KG-augmented code review).
Activity
byapparov commentedon Jun 10, 2026
Item A (snake_case
reasoning_effortsilently dropped) is fixed by #76 and shipped in v0.3.6 —reasoning_effort: "none"in model options now reaches the wire, with precedence over camelCase documented and covered by tests.Items B (
--variant nonefor openai-compatible) and C (docs) are split into #78.Until #78 lands, both spellings work in model options:
reasoning_effort: "none"orreasoningEffort: "none".