Skip to content

[Bug]: sessions_yield parent is not woken after descendants settle #97089

Description

@galiniliev

Bug type

Behavior bug (incorrect output/state without crash)

Beta release blocker

No

Summary

A yielded parent session that was waiting on subagent completions did not receive a usable final wake-up after the remaining children completed, leaving the parent idle until a later manual/user re-entry reconciled the finished work.

Steps to reproduce

  1. In OpenClaw 2026.6.9, run a Telegram-backed parent session that spawns several subagents with sessions_spawn.
  2. Have the parent call sessions_yield while waiting for child completion events.
  3. Let the child sessions finish.
  4. Observe whether each relevant child completion resumes the yielded parent with the completion event.

Observed live session:

  • The parent yielded at 2026-06-26T02:19:02.052Z after dispatching five review specialists.
  • A later wake happened only for one child; the parent called sessions_yield again at 2026-06-26T02:23:24.443Z.
  • The next parent activity was not until 2026-06-26T02:36:02.982Z / 2026-06-26T02:36:08.232Z, when it reconciled all finished children.

Expected behavior

sessions_yield is documented as ending the current turn so subagent results arrive as the next message. A child completion that is still relevant to a yielded parent should either wake the parent or be coalesced into a prompt containing the outstanding completions, without requiring a later user/manual re-entry.

Actual behavior

The children completed, but the yielded parent did not receive a usable final wake-up for the remaining child completions:

2026-06-26T02:19:42.917Z  child completed
2026-06-26T02:20:09.101Z  child completed
2026-06-26T02:20:39.537Z  child completed
2026-06-26T02:23:11.714Z  child completed
2026-06-26T02:23:24.443Z  parent yielded again after receiving only one completion
2026-06-26T02:24:06.365Z  child completed
2026-06-26T02:25:40.519Z  extra/truncated child completed
2026-06-26T02:36:08.232Z  parent finally reconciled list: active=[], total=6

The parent stayed idle for about 12 minutes after the second yield even though all intended children had completed by 2026-06-26T02:24:06.365Z.

Source context checked:

  • src/agents/tools/sessions-yield-tool.ts says the tool ends the current turn so completion events can resume the session later.
  • src/agents/subagent-registry.ts implements resumeSubagentRun.
  • Before the fix, resumeSubagentRun returned early whenever entry.pauseReason === "sessions_yield", even when the run was marked with wakeOnDescendantSettle.

OpenClaw version

2026.6.9

Operating system

linux 6.6.114.1-microsoft-standard-WSL2 (x64)

Install method

Source checkout / local gateway

Model

github-copilot/claude-opus-4.7

Provider / routing chain

OpenClaw -> github-copilot -> claude-opus-4.7 using Anthropic Messages API

Additional provider/model setup details

Telegram channel parent session with OpenClaw subagents. Local logs show provider github-copilot, model id claude-opus-4.7, model API anthropic-messages, Node v26.3.0.

Logs, screenshots, and evidence

Redaction notes: phone/chat ids, Telegram target ids, local paths, auth token values, exact session keys, exact session IDs, exact run IDs, task-specific child names, and a private PR URL were redacted. Timestamps, provider/model names, tool names, and status fields were preserved.

Parent timeline:
2026-06-26T02:19:02.052Z parent yielded after dispatching five subagents
2026-06-26T02:19:42.917Z child completed
2026-06-26T02:20:09.101Z child completed
2026-06-26T02:20:39.537Z child completed
2026-06-26T02:23:11.714Z child completed
2026-06-26T02:23:24.443Z parent yielded again after receiving only one completion
2026-06-26T02:24:06.365Z final intended child completed
2026-06-26T02:25:40.519Z extra/truncated child completed
2026-06-26T02:36:08.232Z parent finally reconciled all children after manual/user re-entry

Current source contract before the fix:
src/agents/tools/sessions-yield-tool.ts: "End current turn. Use after spawning subagents; results arrive as next message."
src/agents/subagent-registry.ts: resumeSubagentRun returned early for pauseReason === "sessions_yield".
src/agents/subagent-registry-lifecycle.ts: deferred descendant cleanup sets wakeOnDescendantSettle=true so the parent can be woken after descendants settle.

Duplicate search:

gitcrawl search openclaw/openclaw --query "subagent.done wake-up yielding parent session sessions_yield wakeOnDescendantSettle" --mode hybrid --json
=> hits: []

gitcrawl search openclaw/openclaw --query "sessions_yield parent descendants settle wake subagent completion" --mode hybrid --json
=> hits: []

Impact and severity

Affected: workflows that depend on yielded parent sessions receiving subagent completion events.

Severity: High for agent orchestration; the delegated work finished, but the parent did not deliver the final result until manual/user re-entry.

Frequency: Observed once in a live multi-subagent review session.

Consequence: missed/delayed parent completion, manual recovery, and extra history/list reconciliation work.

Additional information

NOT_ENOUGH_INFO

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority user-facing bug, regression, or broken workflow.bugSomething isn't workingclawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.impact:session-stateSession, memory, transcript, context, or agent state can drift or corrupt.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.maintainerMaintainer-authored PR

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions