openclaw - ✅(Solved) Fix [Bug]: Ollama adapter does not forward think:false on qwen3; idle-watchdog kills agent turns [1 pull requests, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#69902Fetched 2026-04-22 07:46:48
View on GitHub
Comments
0
Participants
1
Timeline
4
Reactions
0
Participants
Timeline (top)
labeled ×2closed ×1cross-referenced ×1

openclaw agent hangs 20s-3min and is killed by the idle-watchdog when the default model is an Ollama-served qwen3 thinking-mode model. The Ollama adapter does not translate the --thinking off CLI flag (or any equivalent) to think: false on /api/chat, so qwen3 silently enters reasoning mode and the adapter times out waiting for output. Direct HTTP to Ollama with {"think": false} responds in ~98ms.

Root Cause

openclaw agent hangs 20s-3min and is killed by the idle-watchdog when the default model is an Ollama-served qwen3 thinking-mode model. The Ollama adapter does not translate the --thinking off CLI flag (or any equivalent) to think: false on /api/chat, so qwen3 silently enters reasoning mode and the adapter times out waiting for output. Direct HTTP to Ollama with {"think": false} responds in ~98ms.

Fix Action

Fix / Workaround

Agent turns via openclaw agent hang 20s-3:43. Gateway log: [llm-idle-timeout] ollama/qwen3:32b produced no reply before the idle watchdog; retrying same model. Inline /no_think in user prompt is also inconsistent at /api/generate — response still contains a populated thinking field. No way to suppress thinking through OpenClaw's abstraction; only workaround is bypassing openclaw agent and hitting Ollama HTTP directly.

PR fix notes

PR #69967: fix(ollama): forward top-level think on native /api/chat requests

Description (problem / solution / changelog)

Fixes #69902

Summary

This fixes the native Ollama chat path so OpenClaw correctly forwards thinking control as a top-level think field on /api/chat requests.

Root cause

Around extensions/ollama/src/stream.ts:154, think injection still depended on model.api at invocation time. In some paths, native Ollama /api/chat requests did not preserve that condition, so thinking=off could fail to send top-level think: false.

As a result, thinking-capable models such as qwen3 could silently enter reasoning mode, produce no immediate reply, and sit idle long enough to be killed by the idle watchdog.

What changed

  • Moved the native Ollama transport check earlier, to wrapper construction time in extensions/ollama/src/stream.ts:177
  • For native Ollama /api/chat requests:
    • thinking=off now sends top-level think: false
    • any non-off thinking level now sends top-level think: true
  • Kept existing request options such as num_ctx unchanged

Tests

Added request-body regression tests that directly verify the outgoing /api/chat payload:

  • extensions/ollama/src/stream-runtime.test.ts:100
    • verifies think: false is sent when thinking is off
  • extensions/ollama/src/stream-runtime.test.ts:153
    • verifies think: true is sent when thinking is enabled
  • both tests also verify that existing options such as num_ctx are still preserved and that options.think is not used

Docs

Updated docs/providers/ollama.md:466 to document native Ollama thinking control behavior:

  • /think off and openclaw agent --thinking off send top-level think: false
  • non-off thinking levels send top-level think: true

Validation

Ran:

  • pnpm install
  • pnpm test extensions/ollama/src/stream-runtime.test.ts
  • pnpm test extensions/ollama/index.test.ts
  • pnpm check:changed

All passed.

Notes

I did not run a live end-to-end validation against a local Ollama + qwen3 instance in this environment.

Validation for this PR is therefore based on:

  • the adapter request body behavior
  • regression tests
  • existing local test/check coverage

Changed files

  • CHANGELOG.md (modified, +1/-0)
  • docs/providers/ollama.md (modified, +2/-0)
  • extensions/ollama/src/stream-runtime.test.ts (modified, +106/-0)
  • extensions/ollama/src/stream.ts (modified, +5/-8)
RAW_BUFFERClick to expand / collapse

Bug type

Crash (process/app exits or hangs)

Beta release blocker

No

Summary

openclaw agent hangs 20s-3min and is killed by the idle-watchdog when the default model is an Ollama-served qwen3 thinking-mode model. The Ollama adapter does not translate the --thinking off CLI flag (or any equivalent) to think: false on /api/chat, so qwen3 silently enters reasoning mode and the adapter times out waiting for output. Direct HTTP to Ollama with {"think": false} responds in ~98ms.

Steps to reproduce

  1. Install Ollama locally and pull a thinking-capable model: ollama pull qwen3:32b.
  2. Configure OpenClaw: openclaw models auth login --provider ollama pointed at http://127.0.0.1:11434.
  3. Set default: openclaw models set ollama/qwen3:32b.
  4. Run: openclaw agent --agent main --message "/no_think say ok" (also tried --thinking off flag and inline /no_think in prompt).
  5. Observe: hang 20s to 3:43, then gateway log shows [llm-idle-timeout] ollama/qwen3:32b produced no reply before the idle watchdog; retrying same model.
  6. Control: curl -s http://127.0.0.1:11434/api/chat -d '{"model":"qwen3:32b","messages":[{"role":"user","content":"say ok"}],"think":false,"stream":false}' responds in ~98ms with content "ok" and no thinking trace.

Expected behavior

openclaw agent --thinking off (or some provider-level config) should translate to think: false on Ollama's /api/chat for thinking-capable models (qwen3, DeepSeek-R1, etc). Short agent turns should complete in under a second when thinking is suppressed.

Actual behavior

Agent turns via openclaw agent hang 20s-3:43. Gateway log: [llm-idle-timeout] ollama/qwen3:32b produced no reply before the idle watchdog; retrying same model. Inline /no_think in user prompt is also inconsistent at /api/generate — response still contains a populated thinking field. No way to suppress thinking through OpenClaw's abstraction; only workaround is bypassing openclaw agent and hitting Ollama HTTP directly.

OpenClaw version

2026.4.20 (115f05d)

Operating system

macOS 15.x on Apple Silicon (M4 Pro)

Install method

curl -fsSL https://openclaw.ai/install.sh | bash (npm global)

Model

ollama/qwen3:32b (Q4_K_M, 40960 ctx, local Ollama)

Provider / routing chain

openclaw agent (embedded mode, no gateway) -> ollama adapter -> http://localhost:11434/api/chat

Additional provider/model setup details

No response

Logs, screenshots, and evidence

Impact and severity

No response

Additional information

No response

extent analysis

TL;DR

The openclaw agent hangs due to the Ollama adapter not translating the --thinking off flag to think: false on /api/chat, causing the model to enter reasoning mode and timeout.

Guidance

  • Verify that the Ollama adapter is correctly configured to handle the --thinking off flag or its equivalent.
  • Check the OpenClaw documentation for any provider-level configuration options that can be used to suppress thinking for thinking-capable models.
  • Test the curl command provided in the issue to confirm that setting think: false directly on the Ollama API resolves the issue.
  • Consider modifying the Ollama adapter to translate the --thinking off flag to think: false on /api/chat to fix the issue.

Example

No code snippet is provided as the issue does not imply a specific code change, but rather a configuration or adapter issue.

Notes

The issue seems to be specific to the Ollama adapter and its interaction with the OpenClaw agent. The provided curl command suggests that setting think: false directly on the Ollama API resolves the issue, but this is not currently being translated by the adapter.

Recommendation

Apply a workaround by using the curl command directly to hit the Ollama API with think: false set, until the Ollama adapter is updated to correctly handle the --thinking off flag.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

FAQ

Expected behavior

openclaw agent --thinking off (or some provider-level config) should translate to think: false on Ollama's /api/chat for thinking-capable models (qwen3, DeepSeek-R1, etc). Short agent turns should complete in under a second when thinking is suppressed.

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING