Repository navigation
Description
Upstream issue draft — OpenClaw
Repo: https://github.com/openclaw/openclaw/issues/new
Title: Provider timeoutSeconds is theatre — embedded-runner (120s) and lane (210s) watchdogs fire above it
Summary
Setting models.providers.ollama.timeoutSeconds: 600 in ~/.openclaw/openclaw.json does not extend the actual runtime ceiling for an Ollama provider call. Two internal watchdogs intercept the call before the provider timeout has a chance to apply:
- Embedded-runner watchdog: 120 s — fires regardless of provider config.
- Lane watchdog: 210 s — fires regardless of provider config.
The provider's timeoutSeconds value is therefore an upper bound that is always dominated by the inner watchdogs. On hardware where cold-start latency for a 14B-class model exceeds 120 s (Mac Mini M4 Pro 64 GB has been measured at 180–300 s for qwen2.5:14b cold-start under contention), the bot turns up "model timeout" errors that the user can't fix by raising timeoutSeconds.
Symptom
2026-05-08 21:42:18 [agent/embedded] error: model invocation timed out after 120s (provider timeout was 600s)
2026-05-08 21:42:18 [agent/embedded] watchdog: lane closed; spawning replacement
163 model-timeout events on 2026-05-08 alone after OLLAMA_KEEP_ALIVE=-1 was set (which keeps the model resident and reduces but does not eliminate cold-start scenarios — first turn after Ollama daemon restart, or after every-12h KV-cache flush, still trips this).
Root cause (analysis from gateway log inspection)
There appear to be three independent timeout layers that aren't aware of each other:
- Provider
timeoutSeconds(config, default 60s, can be raised to 600s). - Embedded-runner watchdog — 120s hardcoded floor, fires inside the agent runtime regardless of provider config.
- Lane watchdog — 210s hardcoded floor at the gateway lane layer.
A user who raises timeoutSeconds to 600 still has their calls killed at 120 s by layer (2). The config setting silently has no effect for any cold-start scenario above 120s.
Proposed fix
Either:
- (a) Make embedded-runner and lane watchdogs respect
models.providers.<provider>.timeoutSecondsas the controlling value (preferred — keeps a single source of truth in config). - (b) Surface the watchdog values as configurable in
models.providers.<provider>.embeddedRunnerTimeoutSecondsandlanes.timeoutSeconds, with documentation that the min of all three applies.
Either way, the user should be able to set ONE knob and have it apply.
Workaround in place
OLLAMA_KEEP_ALIVE=-1reduces cold-start frequency to "first turn after daemon restart" only.OLLAMA_FLASH_ATTENTION=1+OLLAMA_KV_CACHE_TYPE=q8_0reduce per-turn latency.OLLAMA_NUM_PARALLEL=2allows two concurrent calls without lane contention.
These don't solve the watchdog-floor problem, just reduce the frequency of hitting it.
Environment
openclaw 2026.5.2 (8b2a6e5)- macOS 25.4.0 (Darwin 25.4.0) / arm64 / Mac Mini M4 Pro 64 GB
- Ollama 0.20.2 (MLX backend auto-engaged on Apple Silicon)
- Model under test:
qwen2.5:14b(Q4_K_M, ~9 GB resident)
What I'd expect
timeoutSeconds: 600 in models.providers.ollama allows a 600 s ceiling for cold-start. Currently it's silently ignored.
Related
Pairs with feedback_destructive_remote_ops_need_chat_text and feedback_concrete_example_soul_edits only tangentially. Tracked locally as Operational #3 in docs/18-chatbot-improvement-plan.md. Blocks any Phase 5 bake-off attempt to bench cold-start latency honestly — the 120s watchdog masks differences between models on first call.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 10, 2026
Thanks for the context here. I did a careful shell check against current
main, and this is already implemented.Current main and the latest release already honor provider request timeouts in the embedded model idle watchdog, and the lane timeout is derived from the resolved agent run timeout plus grace rather than a fixed 210s ceiling.
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review details
Best possible solution:
Keep the v2026.5.7/current-main provider-timeout wiring, and use #77744 for any separate reproducible current-release local-model cancellation.
Do we have a high-confidence way to reproduce the issue?
No high-confidence current-main reproduction path was established. The report is against 2026.5.2, while current main and v2026.5.7 source show the reported fixed 120s/210s ceilings are no longer the active path.
Is this the best way to solve the issue?
Yes. The current implementation is the narrow maintainable solution: carry provider request timeout into the idle watchdog and keep whole-run/lane deadlines governed by the agent run timeout.
Security review:
Security review: This is non-PR issue triage with no patch or security-sensitive report to review.
What I checked:
timeoutSecondsis normalized intorequestTimeoutMs, which is the runtime model fact consumed by the embedded runner. (src/agents/pi-embedded-runner/model.ts:340, 15b26be8daf0)resolveLlmIdleTimeoutMsusesmodelRequestTimeoutMsdirectly, bounded only by shorter whole-run timeouts, and disables the default 120s idle watchdog for local provider base URLs when no explicit provider timeout is set. (src/agents/pi-embedded-runner/run/llm-idle-timeout.ts:131, 15b26be8daf0)src/agents/pi-embedded-runner/run.ts:202, 15b26be8daf0)src/agents/pi-embedded-runner/run/llm-idle-timeout.test.ts:45, 15b26be8daf0)timeoutSecondsextends model HTTP handling and the model stream idle watchdog, whileagents.defaults.timeoutSecondsis the whole agent runtime timeout. Public docs:docs/concepts/agent-loop.md. (docs/concepts/agent-loop.md:166, 15b26be8daf0)src/agents/pi-embedded-runner/run/llm-idle-timeout.ts:131, eeef4864494f)Likely related people:
src/agents/pi-embedded-runner/run/llm-idle-timeout.ts,src/agents/timeout.ts)src/agents/pi-embedded-runner/run/llm-idle-timeout.ts,src/agents/pi-embedded-runner/run.ts)Codex review notes: model gpt-5.5, reasoning high; reviewed against 15b26be8daf0; fix evidence: release v2026.5.7, commit eeef4864494f.