openclaw - 💡(How to fix) Fix Bug: sessions_yield wakes parent with yield continuation instead of child completion event

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Fix Action

Fix / Workaround

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

The Gateway does not dispatch child completion events to a yielded parent period.

Child:  work completes → session end (status=done) → LCM persist → END
                                                      No event dispatched to parent

Code Example

[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

---

[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

---

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.logNOT 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

---

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
RAW_BUFFERClick to expand / collapse

Environment

  • OpenClaw version: v2026.5.19
  • Model: deepseek-v4-pro
  • Agent: coder (using sessions_spawn + sessions_yield to delegate to subagent)

Symptoms

When a parent agent calls sessions_spawnsessions_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:

  1. The Gateway should dispatch a child completion event to the parent
  2. This event should wake the parent from the yielded state
  3. The parent transcript should contain the child's completion summary or metadata
  4. The parent can then process completion, verify results, and respond to the user

Affected Sessions

RoleSessionStatusRuntimeTokens
Parentagent:coder:main (c10a8206)done6,819ms
Childagent:omoc_coder:subagent:c329eb41 (label: remove-7-tools)done343,443ms37,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_yield cannot be used to reliably wait for child completion

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING