Repository navigation
Description
Bug type
Regression (worked before, now fails)
Beta release blocker
No
Summary
After updating to OpenClaw 2026.5.3-1, long local llama.cpp requests time out even though the backend is still actively processing the prompt.
The old agents.defaults.llm.idleTimeoutSeconds config is rejected as an unrecognized key. The suggested models.providers.<id>.timeoutSeconds config is accepted and hot reloaded, but it does not prevent the chat from being cut off during long local model prefill.
This looks like the idle watchdog is still using another timeout path that is not configurable through the current schema.
Steps to reproduce
- Install or update OpenClaw to 2026.5.3-1.
- Run OpenClaw in Docker.
- Configure a local llama.cpp / OpenAI-compatible provider.
- Use a large-context local model, for example
qwen3.6-35b. - Configure the agent primary model as
llamacpp/qwen3.6-35b. - Send a very large prompt, around 150k tokens, through webchat.
- Observe that llama.cpp keeps processing the prompt, but OpenClaw cancels before the model produces a reply.
- Try adding
agents.defaults.llm.idleTimeoutSeconds. - Observe OpenClaw rejects the config with
Unrecognized key: "llm". - Try using
models.providers.llamacpp.timeoutSeconds. - Observe the config is accepted and hot reloaded, but the chat still times out.
Expected behavior
OpenClaw should wait for the local provider according to the configured timeout, especially when the provider is still processing a long prefill and has not failed.
A long local llama.cpp prefill should not be treated as a failed model request merely because no output token has been produced yet.
Actual behavior
OpenClaw cuts off the agent request before the local llama.cpp backend finishes prompt prefill and produces a reply.
The llama.cpp server is still alive and processing. It is not dead. The request is cancelled from the OpenClaw side before completion.
When fallbacks are configured, OpenClaw then tries fallback providers even though the local model was still working.
OpenClaw version
2026.5.3-1
Operating system
Docker container on NAS, with local llama.cpp backend running on Mac.
Install method
Docker / custom image based on ghcr.io/openclaw/openclaw:latest.
Model
OpenClaw model id:
llamacpp/qwen3.6-35b
Local backend model:
Qwen3.6-35B-A3B-GGUF
Qwen3.6-35B-A3B-Q6_K.gguf
Provider / routing chain
OpenClaw → local llama.cpp OpenAI-compatible server → /v1/responses
Additional provider/model setup details
Provider config:
"models": {
"mode": "merge",
"providers": {
"llamacpp": {
"baseUrl": "http://cerebro-mac:8080/v1",
"apiKey": "dummy",
"api": "openai-responses",
"timeoutSeconds": 14400,
"models": [
{
"id": "qwen3.6-35b",
"name": "Qwen 3.6 35B A3B local llama.cpp",
"reasoning": true,
"input": ["text"],
"contextWindow": 262144,
"maxTokens": 100000
}
]
}
}
}Agent config:
"agents": {
"defaults": {
"timeoutSeconds": 14400,
"model": {
"primary": "llamacpp/qwen3.6-35b",
"fallbacks": []
},
"compaction": {
"timeoutSeconds": 10800
},
"models": {
"llamacpp/qwen3.6-35b": {
"timeoutSeconds": 14400,
"streaming": true
}
}
}
}Config that no longer works:
{
"agents": {
"defaults": {
"llm": {
"idleTimeoutSeconds": 3600
}
}
}
}This raises:
agents.defaults: Unrecognized key: "llm"
models.providers.llamacpp.timeoutSeconds is accepted by hot reload, but the long request still gets cancelled.
Logs, screenshots, and evidence
OpenClaw logs show fallback and timeout behavior:
Embedded agent failed before reply: All models failed
llamacpp/qwen3.6-35b: LLM request timed out
Config reload confirms models.providers.llamacpp.timeoutSeconds is accepted:
config hot reload applied (... models.providers.llamacpp.timeoutSeconds ...)
Adding agents.defaults.llm.idleTimeoutSeconds fails:
config reload skipped (invalid config): agents.defaults: Unrecognized key: "llm"
The local llama.cpp backend receives the request and starts processing a very large prompt:
task.n_tokens = 152780
prompt processing progress ...
n_tokens = 67584
srv stop: cancel task
done request: POST /v1/responses 200
This suggests the backend was still processing and did not crash. The request was cancelled before the model had a chance to produce a reply.
Impact and severity
Affected: local large-context llama.cpp users.
Severity: Critical for long-running local model workflows.
Frequency: 100% on very large prompts since updating to 2026.5.3-1.
Consequence: long local model requests cannot complete because OpenClaw cancels before the first reply.
Additional information
This appears to be a regression or schema/config mismatch around idle timeout behavior.
The old agents.defaults.llm.idleTimeoutSeconds path is rejected.
The new suggested models.providers.<id>.timeoutSeconds path is accepted but does not stop the idle watchdog cancellation.
Question:
What is the correct supported config key in 2026.5.3-1 to increase the idle watchdog timeout for long local model prefill?
Is there a separate hidden/default idle timeout still active even when models.providers.<id>.timeoutSeconds is set?
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 5, 2026
Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve.
Summary
Keep open: current main and the latest release still match the reported timeout path for a Docker/self-hosted llama.cpp provider using a bare hostname, because the explicit provider timeout is converted to model request metadata but then clamped by the non-local idle-watchdog branch.
Reproducibility: yes. for the source-level mismatch: with
modelRequestTimeoutMs=14400000andbaseUrl=http://cerebro-mac:8080/v1, current main classifies the host as non-local and caps the idle watchdog at 120s. I did not run the full Docker and llama.cpp prefill path.Next step
This is a focused source-backed regression candidate: the failing branch, likely files, related timeout cluster, and validation path are clear enough for one repair PR.
Review details
Best possible solution:
Keep the provider-scoped timeout contract and make explicit
models.providers.<id>.timeoutSecondsreach the model idle watchdog for self-hosted/local OpenAI-compatible providers, including Docker bare-host aliases, without restoringagents.defaults.llm.Do we have a high-confidence way to reproduce the issue?
Yes for the source-level mismatch: with
modelRequestTimeoutMs=14400000andbaseUrl=http://cerebro-mac:8080/v1, current main classifies the host as non-local and caps the idle watchdog at 120s. I did not run the full Docker and llama.cpp prefill path.Is this the best way to solve the issue?
Yes. The narrow maintainable fix is to align the existing provider-timeout contract with the idle watchdog for this self-hosted provider path, not to reintroduce the retired legacy key or add a new timeout hierarchy here.
Acceptance criteria:
What I checked:
models.providers.llamacpp.timeoutSeconds: 14400withbaseUrl: http://cerebro-mac:8080/v1, saw hot reload accept it, and logged OpenClaw cancelling while llama.cpp was still processing a 152k-token prompt; a follow-up comment confirms the replacement key is the specific failing path.timeoutSecondstorequestTimeoutMsand attaches it to configured provider models, so the configured 14400s value reaches the idle resolver input. (src/agents/pi-embedded-runner/model.ts:355, 0ad3d25fb7cd)cerebro-macis not local; for non-local models,modelRequestTimeoutMsgoes throughclampImplicitTimeoutMs, which caps it at the 120s default. (src/agents/pi-embedded-runner/run/llm-idle-timeout.ts:35, 0ad3d25fb7cd)127.0.0.1base URL. (src/agents/pi-embedded-runner/run/llm-idle-timeout.test.ts:46, 0ad3d25fb7cd)models.providers.<id>.timeoutSecondsextends the model idle watchdog for slow local/self-hosted providers and applies to provider HTTP handling plus model stream idle watchdog. Public docs:docs/concepts/agent-loop.md. (docs/concepts/agent-loop.md:169, 0ad3d25fb7cd)timeoutSecondsbut nollmobject, and doctor docs say to removeagents.defaults.llmin favor ofmodels.providers.<id>.timeoutSeconds, so restoring the old key is not the right repair path. (src/config/zod-schema.agent-defaults.ts:245, 0ad3d25fb7cd)Likely related people:
src/agents/pi-embedded-runner/run/llm-idle-timeout.ts,src/agents/pi-embedded-runner/model.ts,docs/concepts/agent-loop.md)src/agents/pi-embedded-runner/run/llm-idle-timeout.ts,src/agents/pi-embedded-runner/run/attempt.ts)src/agents/pi-embedded-runner/run/llm-idle-timeout.ts,src/agents/pi-embedded-runner/run/attempt.ts)Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 0ad3d25fb7cd.
juaps commentedon May 5, 2026
Additional clarification: the most specific regression in my case is that my previous timeout configuration used to work, but after the update the timeout behavior changed.
Before the update, setting timeout-related config was enough to let long local model requests keep running. Now there are two different failure modes:
{ "agents": { "defaults": { "llm": { "idleTimeoutSeconds": 3600 } } } }OpenClaw rejects the config:
OpenClaw accepts / hot reloads the config, but the chat still gets cut off during long local prefill. So the key is accepted, but it does not seem to affect the actual idle watchdog that cancels the request before the first token.
So the specific issue is not just that a local model is slow. The regression is that the timeout configuration that previously allowed long local requests no longer works, and the replacement key appears to configure a different timeout path than the one actually aborting the agent run.
In short:
agents.defaults.llm.idleTimeoutSecondsused to be the obvious setting but is now rejected by schema.models.providers.<id>.timeoutSecondsis accepted but does not prevent the cutoff.That is why I suspect there is still a separate idle watchdog timeout path that is either hardcoded, not exposed in the current schema, or no longer wired to the provider timeout value.
esqandil commentedon May 6, 2026
Adding source-level evidence from 2026.5.4 (
325df3e) for the silent clamp behaviour:The bundled dist code clamps any caller-provided implicit timeout down to a hard 120s ceiling:
with these constants:
DEFAULT_LLM_IDLE_TIMEOUT_MS = 120_000(120s)MAX_SAFE_TIMEOUT_MS = 2_147_001— used as a sentinel: any value ≥ this returns 0, which fully disables the idle watchdog.So:
runTimeoutSeconds: 1800→ clamped silently to 120s. Run dies at 120s.runTimeoutSeconds: 14400→ clamped silently to 120s. Run dies at 120s.runTimeoutSeconds: 2147001→ watchdog disabled entirely (the only way to actually get >120s).This matches the reporter's experience:
models.providers.llamacpp.timeoutSecondsis accepted by hot reload but does not affect the idle watchdog because the watchdog reads from the implicit-timeout pathway, which is clamped.There is no warning or log entry when the clamp fires, so users have no signal that their requested timeout was ignored. We hit this for hours on long-reasoning models (gpt-5.5-pro, gemini-3.x-pro) before the dist source revealed the clamp.
Suggested fixes (in order of preference):
DEFAULT_LLM_IDLE_TIMEOUT_MSand theMAX_SAFE_TIMEOUT_MSsentinel indocs/gateway/configuration-reference.md.Related: #8724 — once per-model
requestTimeoutMsis schema-accepted, the runtime path that reads it (params.model.requestTimeoutMs) bypasses this clamp.fix(llm-idle-timeout): honor models.providers.<id>.timeoutSeconds for…
fix(llm-idle-timeout): honor models.providers.<id>.timeoutSeconds for…
shakkernerd commentedon May 19, 2026
Fixed on current
mainby #83979.The provider timeout now feeds the model idle watchdog directly instead of being clamped back to the implicit ~120s default. I verified the reported self-hosted bare-host path on current
mainwithhttp://cerebro-mac:8080/v1andmodels.providers.<id>.timeoutSeconds: 14400;resolveLlmIdleTimeoutMsreturns14400000ms for that case.Relevant landed path:
src/agents/pi-embedded-runner/run/llm-idle-timeout.ts: explicitmodelRequestTimeoutMsfrommodels.providers.<id>.timeoutSecondsis honored, still bounded by any shorter run/agent timeout.docs/concepts/agent-loop.md: documents that provider timeout now covers the model stream idle watchdog.Closing this as fixed by #83979.