Repository navigation
fix(subagents): preserve private completions across parent yield - #148405
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 14, 2026, 3:19 PM ET / 19:19 UTC (Revision 5). ClawSweeper reviewWhat this changesThe PR preserves private subagent results until the parent turn settles, prevents late announcement failures from overwriting yielded-batch delivery, and adds regression coverage and documentation. Merge readiness✅ Ready for maintainer review The fix remains necessary on the reviewed main revision. No actionable correctness or security findings remain, and the previous stacking prerequisite no longer applies. Priority: P2 Review scores
Verification
How this fits togetherOpenClaw’s subagent registry retains worker results and coordinates their return to the parent agent. Parent settlement chooses individual private review or a combined continuation after an explicit yield. flowchart TD
A[Child finishes] --> B[Registry retains private result]
B --> C[Parent turn settles]
C -->|Normal finish| D[Individual private review]
C -->|Explicit yield| E[Frozen child batch]
E --> F[Parent continuation]
D --> G[Recorded delivery outcome]
F --> G
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +40, Tests +280, Docs +10. Total +330 across 8 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep private results under one settlement owner while preserving requester identity, successful receipts, and the existing restart recovery path. Do we have a high-confidence way to reproduce the issue? Yes: finish a private child before its spawning parent calls sessions_yield. The source and reported before/after Gateway run establish the race; this review did not execute it. Is this the best way to solve the issue? Yes: the patch fixes admission and settlement in the existing registry owners without adding another queue, changing public configuration, or modifying stored formats. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b8de9f88996b. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
687bce9 to
397f7ca
Compare
Keep private results under the spawning turn until it settles, then resume individual review or the existing yielded batch. Fence late failed announcements without discarding committed delivery receipts. The real Gateway regression reproduces the false parent failure before this change and passes with one processed result afterward. Three requester-owner E2E cases, 280 lifecycle/recovery tests, and changed-file checks pass. Related: #147206, #147571, #146667.
397f7ca to
e7de490
Compare
|
Merged via squash.
|
…nclaw#148405) Keep private results under the spawning turn until it settles, then resume individual review or the existing yielded batch. Fence late failed announcements without discarding committed delivery receipts. The real Gateway regression reproduces the false parent failure before this change and passes with one processed result afterward. Three requester-owner E2E cases, 280 lifecycle/recovery tests, and changed-file checks pass. Related: openclaw#147206, openclaw#147571, openclaw#146667.
Remove unused internal announcement inputs, consolidate dispatch and requester preference lookup, and inline single-use replacement and result-selection wrappers. Keep public harness idempotency, routing, authority, receipt, and retry contracts. Validated with 904 focused tests, three real-Gateway requester-owner scenarios, full changed checks, QA runtime build, deslop, and independent P2 review. Related: #148405.
Remove unused internal announcement inputs, consolidate dispatch and requester preference lookup, and inline single-use replacement and result-selection wrappers. Keep public harness idempotency, routing, authority, receipt, and retry contracts. Validated with 904 focused tests, three real-Gateway requester-owner scenarios, full changed checks, QA runtime build, deslop, and independent P2 review. Related: openclaw#148405.
What Problem This Solves
A private child result that finishes before its parent calls
sessions_yieldcan start an obsolete continuation and reportsubagent source lifecycle changed before completion deliveryas a failed parent turn.User Impact
Parents process private results without a false run-failure notice. Finished private children also resume after a normal parent response without waiting for unfinished siblings. Existing task identity, privacy, cancellation, and restart contracts are preserved; no configuration or migration is required.
Why This Change Was Made
The registry retains private results until the spawning turn settles, then uses the existing individual review or yielded-batch owner. Late announcement failures cannot rewrite transferred delivery state, while confirmed sends retain their receipts. This keeps the handoff within the existing lifecycle instead of adding another queue or cancellation controller.
Related: #147206, #147571, #146667.
Evidence
e7de4902fbd5: the native watcher reported GREEN with zero pending checks. ClawSweeper reviewed the same head with no findings or remaining before-merge items.The initial CI run stopped at a duplicate test registration on main. A later run passed all other execution jobs but exposed a stale Custodian test selector. Main now contains the fixes in #148425 and #148444.
The current branch contains only the original subagent commit, replayed onto main at
b8de9f88996b. The temporary #148403 dependency and its catalog deletion are removed. The subagent patch remains identical bygit range-diff, and the test registry matches main byte-for-byte.