Sub-Agent Finished But the Result Never Came Back
You spawn a sub-agent to do research, write code, or handle a task. It runs. Then... nothing. No completion message. No error. You wait, try again, spawn it twice — wasting tokens and time. The sub-agent actually finished its work. The result just never made it back to you.
This is a real, confirmed bug in OpenClaw's sub-agent completion delivery system.
What's Happening Under the Hood
When a sub-agent completes, OpenClaw attempts to deliver the result via a synchronous direct announce back into the requester (parent) session. This is fast and usually works — but it's fragile under common real-world conditions:
- Busy lane / timeout: The requester session's message lane is congested. The direct announce times out.
- Gateway drain/restart: A gateway restart happens between subagent completion and delivery. The queued completion is dropped.
- Orphan prune: A "restore run" for the subagent is detected as a missing session entry and cleaned up before the durable delivery fires.
There's a conditional queue fallback, but it can return "no queue action" — meaning the system silently decides not to retry. The completion exists in the subagent registry, never reaches the plugin layer, and is eventually cleaned up. From your perspective: the agent disappeared.
How to Tell If This Is Your Problem
- Sub-agent shows status "completed" in
subagents listbut no message arrived - The gateway was restarted or the machine went to sleep while the sub-agent was running
- You're running multiple agents on a busy server (high lane congestion)
- Spawning the same task again produces a result — confirming the first run succeeded silently
Workarounds
1. Check Sub-Agent History Directly
The result exists — it just wasn't delivered. Pull it manually:
# List recent sub-agents
subagents list
# Fetch the session history for the completed sub-agent
sessions history --sessionKey <subagent-session-key> --limit 20
The final assistant message from the sub-agent is typically the result you're looking for.
2. Don't Restart the Gateway While Sub-Agents Are Running
Gateway drains are the most common trigger. If you need to restart:
# Check for running sub-agents first
subagents list
# Wait for them to complete, THEN restart
openclaw gateway restart
3. Use streamTo: "parent" for Critical Work
When spawning sub-agents for important tasks, set streamTo: "parent". This streams output back progressively instead of relying on a single completion announcement:
sessions_spawn(
task: "...",
streamTo: "parent"
)
Streamed results don't depend on the announce path and are much more reliable under load.
4. Add a Timeout + Manual Poll Pattern
For long-running sub-agents, build in a manual check rather than relying on push delivery:
# After spawning, note the sessionKey
# After ~expected runtime, poll:
sessions history --sessionKey <key> --limit 5
Expected Fix
The upstream fix requires a durable completion inbox/spool — results get written to a persistent store before delivery is attempted, so restarts and drain events can't lose them. The OpenClaw team has confirmed the issue and is planning the patch. Track it at issue #67777.
Bottom Line
Your sub-agent's work isn't lost — it's stuck in the registry. Check sessions history directly to recover it, and use streamTo: "parent" for anything important until the durable inbox ships.
If you're architecting a multi-agent OpenClaw setup and need help designing around these delivery edge cases, ClawReady can help you build something resilient.