Repository navigation
Description
Environment
- OpenClaw version: v2026.5.19
- Model: deepseek-v4-pro
- Agent: coder (using
sessions_spawn+sessions_yieldto delegate to subagent)
Symptoms
When a parent agent calls sessions_spawn → sessions_yield to wait for a child subagent, and the child completes, the parent never receives a completion notification. The parent is only awakened by a timer-based yield continuation, sees the old yield context ("waiting for child"), assumes the child is still running, and stops — never processing the completion.
The child subagent's work is fully successful, but the parent never learns about it.
Evidence
Parent transcript (c10a8206-5248-4089-9c09-623895716f40.jsonl)
[05:25:26] sessions_spawn → child c329eb41 created
[05:25:34] sessions_yield → "status": "yielded"
[05:25:34] custom_message: openclaw.sessions_yield (yield note)
← 6 minutes of nothing
[05:31:25] assistant: "子 agent 正在执行,等待完成通知。" → stop
↑ parentId = yield note (62054bbe)
↑ No child completion event between yield and this
Child transcript (cd255cda-0103-45bf-b25f-98e3e65c6091.jsonl)
[05:26:23] 6 tool + 2 feature directories deleted
[05:29:08] src/index.ts rewritten (imports + registrations removed)
[05:30:48] npm run build ✅
[05:30:58] npx tsc --noEmit ✅
[05:31:02] todo-4 → completed ← ALL WORK DONE
[05:31:14] "All done. Here's the summary..." ← LAST MESSAGE
Gateway log (openclaw-2026-05-21.log) — 13:31:00–13:31:26 CST
13:31:02 [lcm] child afterTurn (todo-4 completed, persisted)
13:31:15 ⇄ res ✓ agent.wait 349006ms ← timer-based return, NO payload
13:31:15 [lcm] child afterTurnTranscriptReconcile (last child turn)
13:31:16 "All done. Here's the summary..." (console.log — NOT a dispatch)
13:31:18 persona-bootstrap → agent:coder:main ← parent session restarts
13:31:18 [lcm] parent bootstrap + assemble (restores yield context)
13:31:26 "子 agent 正在执行,等待完成通知。" → stop
Root Cause
The Gateway does not dispatch child completion events to a yielded parent period.
There is no subagent_announce, deliverToRequester, wakeParent, or any similar event anywhere in the gateway log. A full-text search of the entire 7438-line log file confirmed zero matches for any child→parent completion delivery mechanism.
The two lifecycles are fully decoupled in the Gateway:
Child: work completes → session end (status=done) → LCM persist → END
↑
No event dispatched to parent
Parent: sessions_yield → agent.wait(timer) → timer fires → return bare
↓
LCM restore yield context
↓
Model sees "still waiting" → stop
The agent.wait call (L5816) returned after 349,006ms with no payload whatsoever — it is purely a timer-based yield continuation, not triggered by child completion.
Expected Behavior
When a child session completes while the parent is yielded via sessions_yield:
- The Gateway should dispatch a child completion event to the parent
- This event should wake the parent from the yielded state
- The parent transcript should contain the child's completion summary or metadata
- The parent can then process completion, verify results, and respond to the user
Affected Sessions
| Role | Session | Status | Runtime | Tokens |
|---|---|---|---|---|
| Parent | agent:coder:main (c10a8206) |
done | 6,819ms | — |
| Child | agent:omoc_coder:subagent:c329eb41 (label: remove-7-tools) |
done | 343,443ms | 37,162 |
Impact
- Parent agent never learns child work is complete → no verification, no result reporting to user
- User sees incomplete response ("still waiting")
- All child work is actually correct and complete — no data loss, but UX is broken
sessions_spawn+sessions_yieldcannot be used to reliably wait for child completion
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Activity
clawsweeper commentedon May 21, 2026
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.
Close as duplicate: the remaining bug is already tracked by the open yielded-parent completion thread, which now includes native
sessions_spawnplussessions_yieldevidence matching this report; this issue’s detailed logs are useful supporting context, but they do not need a separate tracker.Canonical path: Track and fix the yielded-parent completion/resumption contract through #52249, preserving this issue’s transcript/log evidence as supporting data for that canonical work.
So I’m closing this here and keeping the remaining discussion on #52249.
Review details
Best possible solution:
Track and fix the yielded-parent completion/resumption contract through #52249, preserving this issue’s transcript/log evidence as supporting data for that canonical work.
Do we have a high-confidence way to reproduce the issue?
Yes, at source and related-report level: current
mainstill has separate hidden yield-context persistence and completion handoff paths, and the canonical open issue contains matching nativesessions_spawnplussessions_yieldproduction evidence. I did not run a fresh live provider reproduction in this read-only review.Is this the best way to solve the issue?
Yes for triage cleanup: closing this duplicate while routing the fix through the broader open tracker is the best maintainer path. A separate issue would split the same yielded-parent completion contract across multiple queues.
Security review:
Security review: Non-PR issue review; no patch security or supply-chain review applies.
What I checked:
sessions_yieldand that completion events should arrive as the next model-visible message, matching the expected behavior in this report. Public docs:docs/tools/subagents.md. (docs/tools/subagents.md:80, 229490a48924)mainstill persists a hiddenopenclaw.sessions_yieldcontext message withtriggerTurn: false, which explains why a later turn can see the old waiting context if completion does not arrive first. (src/agents/pi-embedded-runner/run/attempt.sessions-yield.ts:121, 229490a48924)main. (src/agents/subagent-announce-delivery.ts:699, 229490a48924)sessions_spawn/sessions_yieldevidence where the yielded parent does not wake or process completion in time.Likely related people:
git shortlogfor the central subagent/yield files and authored yielded subagent pause and related sessions-yield behavior commits. (role: feature-history and recent area contributor; confidence: high; commits: 42514156e03c, 6f3b5f8666f3, 3b2db583cdb1; files:src/agents/pi-embedded-runner/run.ts,src/agents/subagent-announce-delivery.ts,docs/tools/subagents.md)subagent-announce-delivery.ts, directly adjacent to the wake and requester-agent handoff path. (role: recent native completion delivery contributor; confidence: high; commits: 04eac15f43d5, 57ec361682e2; files:src/agents/subagent-announce-delivery.ts,src/agents/subagent-announce-delivery.test.ts)src/agents/subagent-registry-run-manager.ts,src/agents/pi-embedded-runner/run.ts)Codex review notes: model gpt-5.5, reasoning high; reviewed against 229490a48924.