openclaw - 💡(How to fix) Fix [Bug]: Local Ollama agent runs intermittently fail with 'fetch failed' / timeout on 2026.3.8-beta.1 [2 comments, 3 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#44556Fetched 2026-04-08 00:45:17
View on GitHub
Comments
2
Participants
3
Timeline
2
Reactions
0
Timeline (top)
commented ×2

On OpenClaw 2026.3.8-beta.1, local Ollama models are callable directly via ollama run, but OpenClaw agent runs intermittently fail with:

  • LLM request timed out
  • rawErrorPreview":"fetch failed"

This happens for both:

  • qwen3.5:122b-a10b
  • gpt-oss:120b

Error Message

OpenClaw should reliably complete local Ollama requests (as direct ollama run does), or surface a precise network/provider error. {"event":"embedded_run_agent_end", ... "error":"LLM request timed out.", {"event":"embedded_run_agent_end", ... "error":"LLM request timed out.",

Root Cause

On OpenClaw 2026.3.8-beta.1, local Ollama models are callable directly via ollama run, but OpenClaw agent runs intermittently fail with:

  • LLM request timed out
  • rawErrorPreview":"fetch failed"

This happens for both:

  • qwen3.5:122b-a10b
  • gpt-oss:120b

Code Example

$ ollama run qwen3.5:122b-a10b "Reply with exactly: OK"
OK

---

{"event":"embedded_run_agent_end", ... "error":"LLM request timed out.",
 "model":"qwen3.5:122b-a10b","provider":"ollama",
 "rawErrorPreview":"fetch failed"}

{"event":"embedded_run_agent_end", ... "error":"LLM request timed out.",
 "model":"gpt-oss:120b","provider":"ollama",
 "rawErrorPreview":"fetch failed"}

---

$ curl 'http://[::1]:11434/api/tags'
curl: (7) Failed to connect to ::1 port 11434
RAW_BUFFERClick to expand / collapse

Bug type

Regression / unresolved runtime bug (local Ollama via OpenClaw)

Summary

On OpenClaw 2026.3.8-beta.1, local Ollama models are callable directly via ollama run, but OpenClaw agent runs intermittently fail with:

  • LLM request timed out
  • rawErrorPreview":"fetch failed"

This happens for both:

  • qwen3.5:122b-a10b
  • gpt-oss:120b

Environment

  • OpenClaw app: 2026.3.8-beta.1 (2026030801)
  • Host: macOS (Apple Silicon)
  • Mode: local gateway
  • Ollama base URL tested:
    • http://localhost:11434
    • http://127.0.0.1:11434
  • Models present locally:
    • qwen3.5:122b-a10b
    • adam-embed-v1:latest

Repro

  1. Configure OpenClaw Ollama provider with local model aliases.
  2. Switch model to qwen or oss in session.
  3. Send simple prompt (hello, etc).
  4. Observe intermittent timeout/fetch-failed in gateway logs.

Expected behavior

OpenClaw should reliably complete local Ollama requests (as direct ollama run does), or surface a precise network/provider error.

Actual behavior

OpenClaw logs repeated assistant-level failures/timeout despite local Ollama being healthy via CLI.

Evidence

Direct Ollama works:

$ ollama run qwen3.5:122b-a10b "Reply with exactly: OK"
OK

OpenClaw failure logs:

{"event":"embedded_run_agent_end", ... "error":"LLM request timed out.",
 "model":"qwen3.5:122b-a10b","provider":"ollama",
 "rawErrorPreview":"fetch failed"}

{"event":"embedded_run_agent_end", ... "error":"LLM request timed out.",
 "model":"gpt-oss:120b","provider":"ollama",
 "rawErrorPreview":"fetch failed"}

We also verified IPv6 loopback was unavailable on this host:

$ curl 'http://[::1]:11434/api/tags'
curl: (7) Failed to connect to ::1 port 11434

and switched OpenClaw provider baseUrl from localhost to 127.0.0.1 to avoid IPv6 resolution path.

Additional notes

  • This may be in the same class as prior fetch failed/IPv4-vs-IPv6 behavior, but this is specifically impacting local Ollama model execution in agent runs.
  • If helpful, I can provide a sanitized openclaw.json excerpt and full log slice around the failing run IDs.

extent analysis

Fix Plan

To resolve the intermittent timeout and fetch failed errors, we will:

  • Update the OpenClaw configuration to use IPv4 loopback explicitly
  • Implement a retry mechanism for LLM requests
  • Verify the Ollama provider baseUrl configuration

Steps:

  • Update openclaw.json to use http://127.0.0.1:11434 as the Ollama provider baseUrl
  • Add a retry mechanism for LLM requests using a library like retry-as-promised
  • Verify that the Ollama provider is configured correctly and the baseUrl is reachable

Example code for retry mechanism:

const retryAsPromised = require('retry-as-promised');

// Define the retry options
const retryOptions = {
  maxAttempts: 3,
  retryDelay: 500, // 500ms delay between retries
};

// Wrap the LLM request in a retry promise
retryAsPromised(
  () => makeLlmRequest(model, prompt),
  retryOptions
)
.then((response) => {
  // Handle successful response
})
.catch((error) => {
  // Handle error after max retries
});

Verification

To verify that the fix worked:

  • Run the OpenClaw agent with the updated configuration and retry mechanism
  • Send a simple prompt to the agent and verify that the response is received without timeouts or fetch failed errors
  • Check the agent logs for any errors or warnings related to LLM requests

Extra Tips

  • Ensure that the Ollama provider is running and healthy
  • Verify that the baseUrl is reachable and functional
  • Consider adding additional logging and monitoring to detect and diagnose any future issues with LLM requests.

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 should reliably complete local Ollama requests (as direct ollama run does), or surface a precise network/provider error.

Still need to ship something?

×6

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

Back to top recommendations

TRENDING