-
-
Notifications
You must be signed in to change notification settings - Fork 69.5k
[Bug]: Subagent loses original task when model fallback triggers, receives "Continue where you left off" instead #55581
Description
Bug type
Behavior bug (incorrect output/state without crash)
Beta release blocker
No
Summary
When a subagent's default model call fails (e.g., missing API key), the model fallback mechanism correctly switches to the fallback model. However, the original task message is replaced with a recovery message "Continue where you left off. The previous model attempt failed or timed out.", causing the subagent to lose its original task entirely.
Steps to reproduce
- Configure default model as
zai/glm-5-turbowithout an API key - Configure fallback model as
deepseek/deepseek-chat(with valid API key) - Create a subagent via
sessions_spawnwith a task, e.g.,"发送一句'你好'" - Check the subagent's session history
Expected behavior
The subagent should receive the original task message even after model fallback. The fallback should be transparent — the fallback model should receive the same original task.
Actual behavior
The subagent's first user message in session history is:
Continue where you left off. The previous model attempt failed or timed out.
The original task is completely lost. The subagent then spends tokens trying to "recover" from a non-existent previous session.
OpenClaw version
2026.3.13 (61d171a)
Operating system
macOS Darwin 25.3.0 (arm64)
Install method
npm install -g openclaw
Model
zai/glm-5-turbo/deepseek/deepseek-chat
Provider / routing chain
zai (auth failed) → fallback → deepseek
Additional provider/model setup details
"model": {
"primary": "zai/glm-5-turbo",
"fallbacks": [
"deepseek/deepseek-chat",
"deepseek/deepseek-reasoner"
]
},
Logs, screenshots, and evidence
[ERROR] lane task error: lane=subagent durationMs=2
error="FailoverError: No API key found for provider "zai".
Auth store: /Users/cangmang/.openclaw/agents/main/agent/auth-profiles.json"
[WARN] model_fallback_decision:
candidate_failed, reason="auth", status=401,
requestedProvider="zai", requestedModel="glm-5-turbo",
nextCandidateProvider="deepseek", nextCandidateModel="deepseek-chat"
[ERROR] lane task error: lane=session:agent:main:subagent:xxx durationMs=4
error="FailoverError: No API key found for provider "zai"."Impact and severity
- Subagent loses original task, executes meaningless operations
- Wastes tokens and execution time
- Users may mistakenly believe the task was completed if they don't inspect subagent output
Additional information
Environment
- OpenClaw Version: 2026.3.13 (61d171a)
- OS: macOS Darwin 25.3.0 (arm64)
- Node.js: v22.22.1
Root Cause Analysis
When the subagent's first model call fails, OpenClaw's model fallback correctly switches to the backup model. However, when reconstructing the conversation context for the fallback model, the system replaces the original task message with a recovery prompt ("Continue where you left off..."). This causes the subagent to lose its original task.
Suggested Fix
In the model fallback flow for subagents, preserve and pass the original task message to the fallback model instead of replacing it with a recovery message. The fallback should be transparent to the subagent.
Temporary Workaround
- Ensure the default model has a valid API key configured
- Or specify a working model explicitly when spawning subagents: `model: "deepseek/deepseek-chat"