Skip to content

[Bug]: Agent timeout when calling Ollama - qwen2.5:7b works via direct API but OpenClaw agent times out #64710

Description

@yuan-b

Bug type

Regression (worked before, now fails)

Beta release blocker

No

Summary

OpenClaw agent times out when calling Ollama qwen2.5:7b model, despite direct curl to Ollama API succeeding in 7-8 seconds.

Steps to reproduce

  1. docker compose up -d
  2. docker compose exec openclaw-gateway openclaw agent --session-id "test" --message "1+1="
  3. Observe timeout error after 120 seconds

Expected behavior

Agent should return model response "1+1=2" within 10-15 seconds, matching direct API response time of 7-8 seconds.

Actual behavior

Agent returns error: "The model did not produce a response before the LLM idle timeout."
Gateway logs show: "[agent] embedded run failover decision: stage=assistant decision=surface_error reason=timeout provider=ollama/qwen2.5:7b"

OpenClaw version

2026.4.9

Operating system

Windows 11 with WSL2 (Ubuntu)

Install method

docker

Model

ollama/qwen2.5:7b

Provider / routing chain

openclaw -> ollama (direct, no proxy)

Additional provider/model setup details

{
"models": {
"mode": "replace",
"providers": {
"ollama": {
"baseUrl": "http://172.20.48.1:11434",
"apiKey": "ollama-local",
"api": "ollama",
"models": [{"id": "qwen2.5:7b", "name": "Qwen2.5 7B"}]
}
}
}
}

Logs, screenshots, and evidence

Gateway Logs (relevant entries)
text
[agent] embedded run failover decision: stage=assistant decision=surface_error reason=timeout provider=ollama/qwen2.5:7b
The model did not produce a response before the LLM idle timeout.
Direct API Test (SUCCESS)
bash
$ curl -X POST http://172.20.48.1:11434/v1/chat/completions \
  -H "Content-Type: application/json" \
  -d '{"model":"qwen2.5:7b","messages":[{"role":"user","content":"test"}],"stream":false}'
Response: Returns valid model output

Agent Test (FAILURE)
bash
$ openclaw agent --session-id "test" --message "1+1="
Response: The model did not produce a response before the LLM idle timeout.

Verified Working Endpoints
✅ POST /api/generate (native Ollama)

✅ POST /api/chat (Ollama chat API)

✅ POST /v1/chat/completions (OpenAI compatible)

✅ POST /api/chat with tools parameter

Version Regression Test
✅ Working: 2026.3.28-beta.1

❌ Broken: 2026.4.9

Impact and severity

Affected users/systems/channels: All users attempting to use OpenClaw agent with Ollama provider on version 2026.4.9

Severity: Blocks workflow (agent cannot complete any conversation)

Frequency: Always (100% of attempts)

Consequence: Agent cannot respond to any messages when using Ollama provider, making the agent functionality unusable

Additional information

Last known good version: 2026.3.28-beta.1

First known bad version: 2026.4.9

Workaround: Downgrade to version 2026.3.28-beta.1

Additional context:

Direct curl to Ollama works in 7-8 seconds

Network connectivity confirmed (container can reach Ollama)

Model supports tool calling (verified via API test)

Issue persists with timeout values set to 120s, 300s, and 0 (disabled)

Environment variables OPENCLAW_AGENT_MODEL_TIMEOUT do not resolve the issue

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressionBehavior that previously worked and now fails

Type

No type

Fields

Priority

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions