Skip to content

fix: resume parents after sibling subagents settle - #137471

Closed
jalehman wants to merge 1 commit into
mainfrom
openclaw-15c/fix-sibling-settle-wake
Closed

jalehman wants to merge 1 commit into
mainfrom
openclaw-15c/fix-sibling-settle-wake

Conversation

@jalehman

@jalehman jalehman commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #137606, which fixed #137467.

What Problem This Solves

Fixes an issue where a parent agent that called sessions_yield could remain paused after multiple sibling subagents completed. Their results were persisted, but the final requester-settle wake could fail before reaching the parent session.

Why This Change Was Made

The subagent registry now creates one lifecycle-fenced Gateway resolver when activated and reuses it for registry-owned fallback registrations and restoration. This preserves the existing rejection of genuinely mixed Gateway owners while allowing siblings from the same lifecycle to share a valid direct-delivery binding.

User Impact

Parent sessions reliably resume after their sibling subagents settle instead of waiting indefinitely for another user message.

Evidence

  • Added a regression test for two fallback sibling registrations.
  • The test reproduced the failure before the fix: the shared resolver returned undefined.
  • pnpm test src/agents/subagents/registry/subagent-registry.test.ts — 153 passed.
  • pnpm exec oxfmt --check src/agents/subagents/registry/subagent-registry.ts src/agents/subagents/registry/subagent-registry.test.ts — passed.
  • pnpm exec oxlint src/agents/subagents/registry/subagent-registry.ts src/agents/subagents/registry/subagent-registry.test.ts — 0 warnings, 0 errors.
  • git diff --check $(git merge-base HEAD origin/main) — passed.

View the OpenClaw team session

@clawsweeper

clawsweeper Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling size: XS maintainer Maintainer-authored PR labels Sep 3, 2026
@clawsweeper clawsweeper Bot added P1 High-priority user-facing bug, regression, or broken workflow. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@clawsweeper

clawsweeper Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: blocked before merge. Reviewed September 3, 2026, 2:27 PM ET / 18:27 UTC.

ClawSweeper review

What this changes

The PR caches a lifecycle-fenced Gateway resolver for fallback subagent registrations and restoration so sibling completions can resume a yielded parent session.

Merge readiness

⛔ Blocked before merge - 3 items remain

Keep open. The patch fixes the single-activation case, but repeated activation in the same Gateway lifecycle creates a new resolver closure; later fallback siblings then disagree with retained rows and the parent wake again fails closed. Current main still has the pre-fix implementation, so this PR remains necessary.

Priority: P1
Reviewed head: 051cdb0e99dd75f1c3c0d710ca0210b4b918f1a7

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch has a well-supported root cause and net-neutral implementation, but an existing same-lifecycle reactivation sequence leaves the reported wake failure reachable.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a repository member, so the external-contributor proof gate does not apply. The submitted unit-test claim is useful supplemental evidence but does not exercise the repeated-activation requester-wake path.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a repository member, so the external-contributor proof gate does not apply. The submitted unit-test claim is useful supplemental evidence but does not exercise the repeated-activation requester-wake path.
Evidence reviewed 5 items Current main remains unfixed: The fetched main revision retains the same registry source blob as the PR base and still fences a new resolver for every fallback registration; it does not contain this PR's lifecycle resolver field.
Resolver identity controls wake delivery: The resolver helper deliberately returns a rejecting resolver when records do not have the identical binding, and the requester-settle wake passes that result to direct announcement delivery.
Introduced repeated-activation hole: The new code creates and assigns a fresh fenced resolver on every activation, while existing rows intentionally keep their prior binding and future fallback registrations consume the newly assigned one.
Findings 1 actionable finding [P1] Preserve the resolver across repeated same-lifecycle activation
Security None None.

How this fits together

The subagent registry persists child runs and eventually sends a synthesized wake to the parent after all siblings settle. That wake needs all child records to share the same lifecycle-bound Gateway context so direct in-process delivery reaches the parent.

flowchart LR
  A[Parent yields] --> B[Sibling subagents]
  B --> C[Subagent registry]
  C --> D[Shared lifecycle resolver]
  D --> E[Requester settle wake]
  E --> F[Parent resumes]
Loading

Before merge

  • Preserve the resolver across repeated same-lifecycle activation (P1) - A second activateSubagentRegistry call creates a new fenced closure while earlier rows retain the old one. The existing persistence test intentionally activates twice with the same resolver; a fallback sibling registered afterward gets the new closure, so getSharedGatewayContextResolver rejects the batch and the requester wake again cannot use in-process dispatch. This was visible at the earlier reviewed head; extend the fix and coverage to that sequence.
  • Resolve merge risk (P2) - If activation is reentered with the same Gateway resolver, fallback runs registered before and after that call receive distinct closure identities; the shared settle wake rejects them and can leave the parent paused again.
  • Complete next step (P2) - Preserve resolver identity across repeated activation of the same Gateway lifecycle and add the corresponding requester-wake regression coverage before merge.

Findings

  • [P1] Preserve the resolver across repeated same-lifecycle activation — src/agents/subagents/registry/subagent-registry.ts:616-620
Agent review details

Security

None.

PR surface

Source 0, Tests +22. Total +22 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 5 5 0
Tests 1 23 1 +22
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 28 6 +22

Review metrics

Metric Value Why it matters
Production vs test LOC production +5/-5 (net 0); tests +23/-1 (net +22) The production change is net-neutral; the added test needs to cover repeated activation as well as one-time binding identity.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #137467
Summary: This PR is the candidate fix for the linked parent-session settle-wake bug, but its repeated-activation path remains incomplete.

Members:

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

Merge-risk options

Maintainer options:

  1. Preserve same-lifecycle resolver identity (recommended)
    Retain the existing fenced resolver on repeated activation of the same lifecycle and add regression coverage for a sibling registered on each side of reactivation.

Technical review

Best possible solution:

Make same-lifecycle activation preserve one fenced resolver identity, rotate it only for a genuinely new lifecycle, and cover the repeated-activation path through the requester-settle direct delivery boundary.

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

Yes, from source: activate with resolver R, register fallback sibling A, activate again with R, then register B. A and B receive distinct fenced closures, so the shared resolver rejects the settle wake; this read-only review did not execute the scenario.

Is this the best way to solve the issue?

No. Caching one resolver per activation fixes the ordinary path but not the established repeated-activation lifecycle behavior; the canonical resolver must remain stable for an unchanged lifecycle.

Full review comments:

  • [P1] Preserve the resolver across repeated same-lifecycle activation — src/agents/subagents/registry/subagent-registry.ts:616-620
    A second activateSubagentRegistry call creates a new fenced closure while earlier rows retain the old one. The existing persistence test intentionally activates twice with the same resolver; a fallback sibling registered afterward gets the new closure, so getSharedGatewayContextResolver rejects the batch and the requester wake again cannot use in-process dispatch. This was visible at the earlier reviewed head; extend the fix and coverage to that sequence.
    Confidence: 0.97
    Late finding: first raised on code an earlier review cycle already covered.

Overall correctness: patch is incorrect
Overall confidence: 0.96

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add merge-risk: 🚨 availability: A resolver mismatch rejects the direct requester wake and can leave an otherwise completed parent session paused.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply. The submitted unit-test claim is useful supplemental evidence but does not exercise the repeated-activation requester-wake path.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦐 gold shrimp, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P1: The PR addresses a parent-session wake failure, but the same failure remains reachable after repeated same-lifecycle activation.
  • merge-risk: 🚨 availability: A resolver mismatch rejects the direct requester wake and can leave an otherwise completed parent session paused.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🌊 off-meta tidepool and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Not applicable: The author is a repository member, so the external-contributor proof gate does not apply. The submitted unit-test claim is useful supplemental evidence but does not exercise the repeated-activation requester-wake path.

Evidence

What I checked:

Likely related people:

  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Jacqueline Henriksen: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Mert Başar: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Preserve resolver identity across repeated activation of the same lifecycle.
  • Add a regression that registers fallback siblings before and after reactivation and proves one direct requester wake.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
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.

Workflow

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

History

Review history (1 earlier review cycle)
  • reviewed 2026-09-03T18:17:02.115Z sha 051cdb0 :: needs maintainer review before merge. :: none

@clawsweeper clawsweeper Bot added merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 3, 2026
@jalehman

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #137606, merged September 4, 2026 as acdd2bb. That broader repair already fixes the reported resolver-identity defect and the repeated-activation gap. Linked issue #137467 now identifies #137606 as its resolution.

Verified against main at d4580e1. The merged fix is an ancestor of that revision, and inspection of its raw-parent diff confirms both the registry resolver reuse and shared-wrapper composition changes.

A focused probe using exact source-extracted binding functions found:

  • PR base: fallback sibling, repeated-activation, and distinct-wrapper cases fail.
  • fix: resume parents after sibling subagents settle #137471 head: fallback siblings pass, but repeated activation and distinct wrappers still fail.
  • Main: all three pass, while retired-fence and mixed-instance rejection remain intact.

This is binding-level executable evidence plus source-path review, not a fresh end-to-end parent-wake test.

@jalehman jalehman closed this Sep 15, 2026
@RomneyDa
RomneyDa deleted the openclaw-15c/fix-sibling-settle-wake branch October 22, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling maintainer Maintainer-authored PR merge-risk: 🚨 availability 🚨 May cause crashes, hangs, restart loops, stalls, or process outages. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: XS status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Parent session remains paused after sibling subagents complete

1 participant