openclaw - 💡(How to fix) Fix agents.defaults.timeoutSeconds not respected for local OpenAI-compatible providers [4 comments, 5 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#60636Fetched 2026-04-08 02:48:55
View on GitHub
Comments
4
Participants
5
Timeline
7
Reactions
2
Author
Timeline (top)
commented ×4subscribed ×2cross-referenced ×1

agents.defaults.timeoutSeconds in openclaw.json is not respected when using local OpenAI-compatible providers (Ollama, mlx_vlm.server). Requests to local 31B models time out after ~30 seconds despite the config being set to 600.

Error Message

  • Direct curl to local server works fine (2-8 seconds warm, 19-33 seconds cold)
  • OpenClaw consistently times out after ~30 seconds with: "Request timed out before a response was generated. Please try again, or increase agents.defaults.timeoutSeconds in your config."
  • The resolveAgentTimeoutSeconds() function in content-blocks-CWb2xgCb.js correctly reads the config value
  • The timeout appears to originate from the WebSocket RPC layer or the AI SDK's internal fetch/stream timeout, not from the agent turn timeout

Root Cause

agents.defaults.timeoutSeconds in openclaw.json is not respected when using local OpenAI-compatible providers (Ollama, mlx_vlm.server). Requests to local 31B models time out after ~30 seconds despite the config being set to 600.

Fix Action

Fix / Workaround

Workaround needed

Please either:

  1. Respect agents.defaults.timeoutSeconds end-to-end, OR
  2. Add a per-provider timeoutMs config key (currently rejected), OR
  3. Document which internal timeout is the actual bottleneck so it can be patched

Code Example

"agents": {
  "defaults": {
    "timeoutSeconds": 600,
    ...
  }
}
RAW_BUFFERClick to expand / collapse

Description

agents.defaults.timeoutSeconds in openclaw.json is not respected when using local OpenAI-compatible providers (Ollama, mlx_vlm.server). Requests to local 31B models time out after ~30 seconds despite the config being set to 600.

Environment

  • OpenClaw 2026.4.2
  • macOS (Apple Silicon, 128GB)
  • Model: Gemma 4 31B (Q8_0 via Ollama, 8-bit via mlx_vlm.server)
  • Provider config: api: "openai-completions", baseUrl: "http://127.0.0.1:11434/v1"

Config

"agents": {
  "defaults": {
    "timeoutSeconds": 600,
    ...
  }
}

Observed behavior

  • Direct curl to local server works fine (2-8 seconds warm, 19-33 seconds cold)
  • OpenClaw consistently times out after ~30 seconds with: "Request timed out before a response was generated. Please try again, or increase agents.defaults.timeoutSeconds in your config."
  • The resolveAgentTimeoutSeconds() function in content-blocks-CWb2xgCb.js correctly reads the config value
  • The timeout appears to originate from the WebSocket RPC layer or the AI SDK's internal fetch/stream timeout, not from the agent turn timeout

Investigation

Traced through the code:

  • resolveAgentTimeoutMs in content-blocks-CWb2xgCb.js:750 correctly resolves config value
  • resolveTurnTimeoutMs in pi-embedded-BYdcxQ5A.js:13343 correctly calls the above
  • DEFAULT_AGENT_TIMEOUT_SECONDS is 172800 (48h) — not the bottleneck
  • The actual abort happens before the configured timeout fires
  • MLX server logs show socket.send() raised exception (OpenClaw disconnects) while the model is still processing
  • A requestTimeout provider-level config key is rejected as "Unrecognized key"

Related

  • #46049 (LLM request timeout ignores configured timeout settings)
  • #43946 (Configurable LLM request timeout per provider/model)

Expected

The timeoutSeconds config should control ALL timeouts in the request chain, including the underlying HTTP/WebSocket transport to the LLM provider. For local models that need 60-120 seconds to prefill large system prompts, 30 seconds is unusable.

Workaround needed

Please either:

  1. Respect agents.defaults.timeoutSeconds end-to-end, OR
  2. Add a per-provider timeoutMs config key (currently rejected), OR
  3. Document which internal timeout is the actual bottleneck so it can be patched

extent analysis

TL;DR

The agents.defaults.timeoutSeconds config value is not being respected for local OpenAI-compatible providers, causing requests to time out after ~30 seconds, and a workaround or fix is needed to increase the timeout.

Guidance

  • Investigate the WebSocket RPC layer or the AI SDK's internal fetch/stream timeout to identify the actual bottleneck, as the issue seems to originate from there.
  • Consider adding a per-provider timeoutMs config key, as suggested in the issue, to allow for more fine-grained control over timeouts.
  • Review the related issues (#46049 and #43946) to see if they provide any insight or potential solutions to the problem.
  • Verify that the resolveAgentTimeoutSeconds() function is correctly reading the config value and that the DEFAULT_AGENT_TIMEOUT_SECONDS is not the cause of the issue.

Example

No code snippet is provided as the issue does not explicitly mention a specific code change that can be made to fix the issue.

Notes

The issue seems to be related to the internal timeout of the WebSocket RPC layer or the AI SDK, and not the agents.defaults.timeoutSeconds config value. More investigation is needed to identify the root cause of the issue.

Recommendation

Apply a workaround, such as adding a per-provider timeoutMs config key, as the current implementation does not respect the agents.defaults.timeoutSeconds config value, and increasing the timeout is necessary for local models that require more time to prefill large system prompts.

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…

Still need to ship something?

×6

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

Back to top recommendations

TRENDING