Skip to content

fix: wake yielded parent after subagents finish#97090

Merged
galiniliev merged 2 commits into
openclaw:mainfrom
galiniliev:bug-045-subagent-done-yield-wakeup
Jun 26, 2026
Merged

fix: wake yielded parent after subagents finish#97090
galiniliev merged 2 commits into
openclaw:mainfrom
galiniliev:bug-045-subagent-done-yield-wakeup

Conversation

@galiniliev

@galiniliev galiniliev commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Closes #97089

What Problem This Solves

Fixes an issue where users running parent sessions that call sessions_yield while waiting for subagents could miss the final wake-up after descendant subagents finished, leaving the parent idle until a later manual/user re-entry.

Why This Change Was Made

The registry already has a descendant-settle wake path for ended orchestrator runs, but the resume gate returned early for every sessions_yield pause. This keeps ordinary yielded runs paused, while allowing yielded orchestrators marked wakeOnDescendantSettle to re-enter the existing descendant wake path.

User Impact

Yielded parent sessions can resume when outstanding subagent work settles instead of waiting for a user to poke the session. This improves multi-subagent review and orchestration workflows without changing transport-specific delivery behavior.

Evidence

Live before-fix log evidence

Sanitized direct log evidence from the original BUG-045 extraction. Exact session ids, run ids, session keys, task names, local paths, channel target ids, private workflow names, and private PR context are redacted.

Parent timeline preserved from the local postmortem memory note:

2026-06-26T02:17Z        parent dispatched 5 intended subagents
2026-06-26T02:19:42Z     child completed successfully
2026-06-26T02:20:09Z     child completed successfully
2026-06-26T02:20:39Z     child completed successfully
2026-06-26T02:23:11Z     child completed successfully
2026-06-26T02:23:25Z     side-channel Telegram event observed one completion
2026-06-26T02:24:06Z     final intended child completed successfully
2026-06-26T02:25:40Z     extra/truncated child exited
2026-06-26T02:25:40Z-02:36:01Z  parent stayed idle; no wake-up was delivered after all intended children completed
2026-06-26T02:36:01Z     user manually re-entered the thread
2026-06-26T02:36:08Z     parent reconciled completed children

Representative child trajectory terminal rows from the extracted raw logs:

{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:19:46.863Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:20:09.309Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:20:39.637Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:23:12.099Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:24:06.459Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}

Pre-fix source state captured in the same extraction:

src/agents/tools/sessions-yield-tool.ts:4  Ends the current turn after subagent spawning so completion events can resume the session later.
src/agents/tools/sessions-yield-tool.ts:22 description: "End current turn. Use after spawning subagents; results arrive as next message."

src/agents/subagent-registry.ts:615 function resumeSubagentRun(runId: string) {
src/agents/subagent-registry.ts:626   if (typeof entry.endedAt === "number" && isDeliverySuspended(entry)) {
src/agents/subagent-registry.ts:627     return;
src/agents/subagent-registry.ts:628   }
src/agents/subagent-registry.ts:629   if (entry.pauseReason === "sessions_yield") {
src/agents/subagent-registry.ts:630     return;
src/agents/subagent-registry.ts:631   }

The original parent JSONL/trajectory was no longer present by the time the bug folder was created, so the parent-side proof above comes from the preserved postmortem/copy. The child terminal rows are direct extracted trajectory rows showing the intended children finished successfully before the parent remained idle.

Regression proof

Before the fix, the new regression reproduced the bug:

× |agents| src/agents/subagent-registry.test.ts > subagent registry seam flow > wakes a sessions_yield-paused parent when pending descendants settle 1031ms
  → expected "vi.fn()" to be called 2 times, but got 1 times

FAIL  |agents| src/agents/subagent-registry.test.ts > subagent registry seam flow > wakes a sessions_yield-paused parent when pending descendants settle
AssertionError: expected "vi.fn()" to be called 2 times, but got 1 times

After the fix:

$ node scripts/run-vitest.mjs src/agents/subagent-registry.test.ts -- --reporter=verbose

✓ |agents| src/agents/subagent-registry.test.ts > subagent registry seam flow > finalizes expired delete-mode parents when descendant cleanup retriggers deferred announce handling 14ms
✓ |agents| src/agents/subagent-registry.test.ts > subagent registry seam flow > wakes a sessions_yield-paused parent when pending descendants settle 8ms

Test Files  1 passed (1)
     Tests  66 passed (66)
[test] passed 1 Vitest shard in 23.78s

Additional checks:

$ git diff --check
# passed with no output

$ .agents/skills/autoreview/scripts/autoreview --mode local
autoreview clean: no accepted/actionable findings reported
overall: patch is correct (0.82)

Real behavior proof

Behavior addressed: A sessions_yield-paused parent/orchestrator run with wakeOnDescendantSettle was skipped by resumeSubagentRun, so descendant completion cleanup could not reach the existing parent wake path.

Real environment tested: Local OpenClaw source worktree based on upstream/main, Node/Vitest agent test lane via node scripts/run-vitest.mjs.

Exact steps or command run after this patch: node scripts/run-vitest.mjs src/agents/subagent-registry.test.ts -- --reporter=verbose; git diff --check; .agents/skills/autoreview/scripts/autoreview --mode local.

Evidence after fix: Terminal capture above shows src/agents/subagent-registry.test.ts passed with 66 passed (66), including wakes a sessions_yield-paused parent when pending descendants settle; git diff --check passed with no output; autoreview reported no accepted/actionable findings.

Observed result after fix: The regression now observes two announce/wake attempts: the child completion announce and the yielded parent wake announce with wakeOnDescendantSettle: true.

What was not tested: I did not rerun the original live Telegram/github-copilot workflow because it depends on private channel/provider credentials and the original live session state.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: S maintainer Maintainer-authored PR labels Jun 26, 2026
@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 26, 2026, 7:28 PM ET / 23:28 UTC.

Summary
The PR narrows resumeSubagentRun's sessions_yield guard so wakeOnDescendantSettle runs can reach the existing descendant wake path, with a focused regression test.

Reproducibility: yes. Source-level reproduction is high-confidence: current main sets wakeOnDescendantSettle during descendant deferral, but resumeSubagentRun returns for all sessions_yield pauses before the existing wake path can run.

Review metrics: 1 noteworthy metric.

  • Current-main merge surface: 2 files, +58/-1. The actionable merge result is the narrow agents guard and regression test, not the stale 119-file base-drift surface shown by the PR file list.

Stored data model
Persistent data-model change detected: persistent cache schema: extensions/memory-core/src/memory/qmd-manager.ts, persistent cache schema: extensions/memory-core/src/memory/qmd-runtime-cache.test.ts, persistent cache schema: extensions/memory-core/src/memory/qmd-runtime-cache.ts, persistent cache schema: ui/src/i18n/.i18n/pt-BR.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/th.tm.jsonl, persistent cache schema: ui/src/i18n/.i18n/tr.tm.jsonl, and 36 more. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster
Relationship: fixed_by_candidate
Canonical: #97089
Summary: This PR is the direct candidate fix for the canonical narrow issue about yielded parents not waking after descendants settle; broader yielded-parent work overlaps but does not supersede this focused branch.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Merge readiness
Overall: 🦪 silver shellfish
Proof: 🦪 silver shellfish
Patch quality: 🐚 platinum hermit
Result: blocked until real behavior proof from a real setup is added.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • [P1] Add redacted after-fix runtime logs, terminal output, or a short transcript showing a real yielded parent waking after descendant settlement.
  • Redact private IDs, endpoints, paths, phone numbers, API keys, and non-public workflow data before posting proof.
  • Update the PR body after adding proof so ClawSweeper re-reviews the exact head; if it does not run, ask a maintainer to comment @clawsweeper re-review.

Proof guidance:

  • [P1] Needs real behavior proof before merge: The PR has useful live before-fix logs, but after-fix proof is limited to Vitest/autoreview output and does not show a real yielded parent waking on this head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Mantis proof suggestion
The original repro was Telegram-backed, and a live Telegram transcript would materially prove that the yielded parent wake reaches a real transport path. A maintainer can ask Mantis to capture proof by posting this exact PR comment:

@openclaw-mantis telegram live: verify a parent session that uses sessions_spawn then sessions_yield wakes after descendant subagents settle.

Risk before merge

  • [P1] After-fix proof is still unit-test/autoreview output only; it does not show a real yielded parent waking on this PR head.
  • [P1] The change intentionally lets a yielded parent session re-enter completion delivery when wakeOnDescendantSettle is set, so maintainers should accept the session-state and message-delivery behavior before merge.
  • [P1] The broader yielded-parent lifecycle PR at fix: keep yielded parent turns nonterminal #95996 partially overlaps; maintainers should deliberately choose the narrow fix or fold this guard into that broader direction.

Maintainer options:

  1. Request After-Fix Runtime Proof (recommended)
    Ask for redacted logs, terminal output, or a short transcript showing a real yielded parent with descendants waking after settlement on this PR head.
  2. Accept Source-Level Proof
    A maintainer may intentionally accept the focused source reproduction and regression test as enough for this small agents seam despite the missing live after-fix run.
  3. Coordinate With Broader Lifecycle Work
    Pause this PR if maintainers want the descendant-settle wake behavior to land only as part of the wider yielded-parent lifecycle PR.

Next step before merge

  • [P1] Human review is required because the PR has a protected maintainer label and the remaining blocker is proof plus merge-risk acceptance, not a narrow code repair.

Security
Cleared: Cleared: the current merge result touches only the agents resume guard and regression test, with no CI, dependency, secret, or build-supply-chain changes.

Review details

Best possible solution:

Land this narrow guard after maintainer review and redacted after-fix runtime proof, or deliberately fold the same guard into the broader yielded-parent lifecycle work if maintainers choose that path.

Do we have a high-confidence way to reproduce the issue?

Yes. Source-level reproduction is high-confidence: current main sets wakeOnDescendantSettle during descendant deferral, but resumeSubagentRun returns for all sessions_yield pauses before the existing wake path can run.

Is this the best way to solve the issue?

Yes for the code shape. The PR is the narrowest maintainable fix I found: ordinary yielded runs stay paused, while only yielded orchestrators explicitly marked for descendant-settle wake can reach the existing announce/wake flow.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against bdd365a34882.

Label changes

Label justifications:

  • P1: The PR targets a broken yielded parent/subagent workflow where completed child work may not wake the parent until manual user re-entry.
  • merge-risk: 🚨 session-state: The diff changes the state transition for yielded parent runs marked wakeOnDescendantSettle, allowing them to resume after descendant cleanup.
  • merge-risk: 🚨 message-delivery: The changed wake path affects when child completion findings are delivered back into the parent session.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🐚 platinum hermit.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs real behavior proof before merge: The PR has useful live before-fix logs, but after-fix proof is limited to Vitest/autoreview output and does not show a real yielded parent waking on this head. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed

What I checked:

  • Repository policy read: Read the full root AGENTS.md and scoped guidance for agents, agent tools, extensions, docs, UI, scripts, plugin SDK, plugins, channels, and tests; the review applied the PR-proof, protected-label, and merge-risk guidance. (AGENTS.md:1, bdd365a34882)
  • Current merge result is narrow: Comparing current main to GitHub's potential merge commit shows only src/agents/subagent-registry.ts and src/agents/subagent-registry.test.ts change, so the large stale-base file list is not the actual current merge surface. (5720c393a97f)
  • Current main blocks the wake path: On current main, resumeSubagentRun returns for every pauseReason === "sessions_yield" before it can call startSubagentAnnounceCleanupFlow. (src/agents/subagent-registry.ts:629, bdd365a34882)
  • Existing lifecycle marks descendant-settle wakeups: The descendant deferral path already sets entry.wakeOnDescendantSettle = true, clears cleanup handling, persists, and schedules a retry. (src/agents/subagent-registry-lifecycle.ts:894, bdd365a34882)
  • Existing announce flow owns the wake: runSubagentAnnounceFlow already calls wakeSubagentRunAfterDescendants when wakeOnDescendantSettle is true and child completion findings exist. (src/agents/subagent-announce.ts:368, bdd365a34882)
  • Patch routes only the marked yielded case: The merge result keeps ordinary yielded runs paused while allowing yielded runs marked wakeOnDescendantSettle to continue into the existing wake path. (src/agents/subagent-registry.ts:631, 5720c393a97f)

Likely related people:

  • steipete: Recent subagent registry lifecycle/refactor commits split and maintained the cleanup and retry surfaces involved in this wake path. (role: recent area contributor; confidence: high; commits: f862685ed8e4, ca3e5ffd892a; files: src/agents/subagent-registry.ts, src/agents/subagent-registry-lifecycle.ts)
  • jriff: Authored the merged PR that introduced the sessions_yield cooperative turn-ending tool and its completion-event contract. (role: feature introducer; confidence: high; commits: 3fa91cd69d5d; files: src/agents/tools/sessions-yield-tool.ts)
  • tyler6204: Authored the merged descendant-gated announce delivery work that introduced the wakeOnDescendantSettle behavior family used by this fix. (role: descendant-gating contributor; confidence: medium; commits: 81b93b9ce04b; files: src/agents/subagent-announce.ts, src/agents/subagent-registry-lifecycle.ts)
  • Tak Hoffman: Authored adjacent resumed cleanup give-up handling in the same lifecycle area, which is relevant to retry and expiry behavior around subagent announces. (role: adjacent cleanup contributor; confidence: medium; commits: c3744fbfc468; files: src/agents/subagent-registry-lifecycle.ts, src/agents/subagent-registry.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

How this review workflow works
  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. labels Jun 26, 2026
@galiniliev galiniliev self-assigned this Jun 26, 2026
@galiniliev

Copy link
Copy Markdown
Contributor Author

Sanitized direct log evidence from the original BUG-045 extraction. This is the live before-fix proof; exact session ids, run ids, session keys, task names, local paths, channel target ids, private workflow names, and private PR context are redacted.

Parent timeline preserved from the local postmortem memory note:

2026-06-26T02:17Z        parent dispatched 5 intended subagents
2026-06-26T02:19:42Z     child completed successfully
2026-06-26T02:20:09Z     child completed successfully
2026-06-26T02:20:39Z     child completed successfully
2026-06-26T02:23:11Z     child completed successfully
2026-06-26T02:23:25Z     side-channel Telegram event observed one completion
2026-06-26T02:24:06Z     final intended child completed successfully
2026-06-26T02:25:40Z     extra/truncated child exited
2026-06-26T02:25:40Z-02:36:01Z  parent stayed idle; no wake-up was delivered after all intended children completed
2026-06-26T02:36:01Z     user manually re-entered the thread
2026-06-26T02:36:08Z     parent reconciled completed children

Representative child trajectory terminal rows from the extracted raw logs:

{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:19:46.863Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:20:09.309Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:20:39.637Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:23:12.099Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}
{"traceSchema":"openclaw-trajectory","schemaVersion":1,"traceId":"[redacted-child-session-id]","source":"runtime","type":"session.ended","ts":"2026-06-26T02:24:06.459Z","seq":7,"sourceSeq":7,"sessionId":"[redacted-child-session-id]","sessionKey":"agent:[redacted-agent]:subagent:[redacted-child-key]","runId":"[redacted-run-id]","provider":"github-copilot","modelId":"claude-opus-4.7","modelApi":"anthropic-messages","data":{"status":"success","aborted":false,"externalAbort":false,"timedOut":false,"idleTimedOut":false,"timedOutDuringCompaction":false,"timedOutDuringToolExecution":false}}

Pre-fix source state captured in the same extraction:

src/agents/tools/sessions-yield-tool.ts:4  Ends the current turn after subagent spawning so completion events can resume the session later.
src/agents/tools/sessions-yield-tool.ts:22 description: "End current turn. Use after spawning subagents; results arrive as next message."

src/agents/subagent-registry.ts:615 function resumeSubagentRun(runId: string) {
src/agents/subagent-registry.ts:626   if (typeof entry.endedAt === "number" && isDeliverySuspended(entry)) {
src/agents/subagent-registry.ts:627     return;
src/agents/subagent-registry.ts:628   }
src/agents/subagent-registry.ts:629   if (entry.pauseReason === "sessions_yield") {
src/agents/subagent-registry.ts:630     return;
src/agents/subagent-registry.ts:631   }

The original parent JSONL/trajectory was no longer present by the time the bug folder was created, so the parent-side proof above comes from the preserved postmortem/copy. The child terminal rows are direct extracted trajectory rows showing the intended children finished successfully before the parent remained idle.

@galiniliev

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event repository_dispatch).
Result: the existing ClawSweeper review comment will be edited in place when the review finishes.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui extensions: memory-core Extension: memory-core cli CLI command changes scripts Repository scripts commands Command implementations channel: feishu Channel integration: feishu size: XL and removed size: S labels Jun 26, 2026
@galiniliev
galiniliev merged commit 6883c6c into openclaw:main Jun 26, 2026
149 of 153 checks passed
@galiniliev

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@galiniliev
galiniliev deleted the bug-045-subagent-done-yield-wakeup branch June 26, 2026 23:31
wangmiao0668000666 pushed a commit to wangmiao0668000666/openclaw that referenced this pull request Jun 27, 2026
* fix: wake yielded subagent parents after descendants settle

* fix: wake yielded subagent parents after descendants settle

---------

Co-authored-by: Galin Iliev <[email protected]>
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Jun 27, 2026
* fix: wake yielded subagent parents after descendants settle

* fix: wake yielded subagent parents after descendants settle

---------

Co-authored-by: Galin Iliev <[email protected]>
xydigit-zt pushed a commit to xydigit-zt/xydigit-zt-openclaw that referenced this pull request Jun 28, 2026
* fix: wake yielded subagent parents after descendants settle

* fix: wake yielded subagent parents after descendants settle

---------

Co-authored-by: Galin Iliev <[email protected]>
QiuYuang pushed a commit to QiuYuang/openclaw that referenced this pull request Jul 1, 2026
* fix: wake yielded subagent parents after descendants settle

* fix: wake yielded subagent parents after descendants settle

---------

Co-authored-by: Galin Iliev <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui channel: feishu Channel integration: feishu cli CLI command changes commands Command implementations docs Improvements or additions to documentation extensions: memory-core Extension: memory-core maintainer Maintainer-authored PR merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. merge-risk: 🚨 session-state 🚨 May lose, corrupt, stale, or mis-associate session, agent, or context state. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. scripts Repository scripts size: XL status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant