Summary
Cron jobs running payload.kind=agentTurn against local models intermittently time out and/or hit context truncation failures, even when sessionTarget: "isolated" and payload.maxMessages/max_tokens are set.
Environment
- OpenClaw CLI:
2026.2.19-2 (45d9b20)
- Cron job: Aicia Gmail Monitor v2
- schedule: every 5m (
everyMs=300000)
- sessionTarget:
isolated
- model:
local/zai-org/glm-4.7-flash
- payload.timeoutSeconds:
120
- maxRunSeconds:
120
- payload.maxMessages:
10
- payload.max_tokens:
512
Observed behavior
From openclaw cron runs --id <jobId>:
- Frequent errors:
Error: cron: job execution timed out (typically at ~60000ms before we increased limits)
- Also observed (returned as summary text):
Cannot truncate prompt with n_keep (11643) >= n_ctx (8192)
Connection error.
- Some runs show unexpectedly huge prompt usage under a different provider/model:
- provider:
ollama, model: qwen3.5:397b
- input_tokens: ~50k
Expected behavior
sessionTarget: isolated should prevent any history/prompt bloat across runs.
payload.maxMessages and payload.max_tokens should cap request size deterministically.
- A job configured for a specific model should not silently execute under a different provider/model (or at least should log/flag this explicitly).
Questions / suspected issues
- Is
maxMessages and/or max_tokens currently enforced for cron agentTurn jobs?
- Why can an
isolated cron run still end up with a prompt that triggers n_keep >= n_ctx?
- Under what conditions will cron execute with a different provider/model than configured?
- Should
payload.timeoutSeconds automatically set maxRunSeconds (they can diverge today)?
Repro (approx)
- Create cron job:
sessionTarget: isolated
payload.kind=agentTurn
- model
local/zai-org/glm-4.7-flash
- short message instructing to run a local script
- Run at a tight interval (1–5 minutes)
- Observe timeouts and occasional context/truncation errors in run history.
Why this matters
This looks like the root cause behind "cron congestion" / recurring timeouts for local-model automation workloads.
Summary
Cron jobs running
payload.kind=agentTurnagainst local models intermittently time out and/or hit context truncation failures, even whensessionTarget: "isolated"andpayload.maxMessages/max_tokensare set.Environment
2026.2.19-2 (45d9b20)everyMs=300000)isolatedlocal/zai-org/glm-4.7-flash12012010512Observed behavior
From
openclaw cron runs --id <jobId>:Error: cron: job execution timed out(typically at ~60000ms before we increased limits)Cannot truncate prompt with n_keep (11643) >= n_ctx (8192)Connection error.ollama, model:qwen3.5:397bExpected behavior
sessionTarget: isolatedshould prevent any history/prompt bloat across runs.payload.maxMessagesandpayload.max_tokensshould cap request size deterministically.Questions / suspected issues
maxMessagesand/ormax_tokenscurrently enforced for cronagentTurnjobs?isolatedcron run still end up with a prompt that triggersn_keep >= n_ctx?payload.timeoutSecondsautomatically setmaxRunSeconds(they can diverge today)?Repro (approx)
sessionTarget: isolatedpayload.kind=agentTurnlocal/zai-org/glm-4.7-flashWhy this matters
This looks like the root cause behind "cron congestion" / recurring timeouts for local-model automation workloads.