Repository navigation
fix(agents): resume parent after late subagent completion - #119696
Conversation
e4264e2 to
ee74ca5
Compare
|
@clawsweeper re-review Please review exact head Exact-head QA evidence is now complete: |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 3:29 PM ET / 19:29 UTC. ClawSweeper reviewWhat this changesThe PR prevents a requester wake admitted before a yield re-arm from mutating the newer subagent-completion batch after lazy runtime loading. Merge readinessKeep open for maintainer review. The generation fence appears to repair the stale-wake ownership race without a diff-introduced correctness finding, but this MEMBER-authored draft has the protected Priority: P1 Review scores
Verification
How this fits togetherSubagent completion delivery persists requester wake state after delegated agents finish. The lifecycle scheduler consumes that state to start one follow-up parent turn, allowing the parent to synthesize child results. flowchart LR
A[Child agents finish] --> B[Completion delivery]
B --> C[Requester yield settlement]
C --> D[Wake generation recorded]
D --> E[Lifecycle wake decision]
E --> F[Parent synthesis reply]
Decision needed
Why: Repository policy requires direct Codex source inspection for Codex-related verdicts, but the required checkout was unavailable in this review environment. Before merge
Agent review detailsSecurityNone. PR surfaceSource +4, Tests +174. Total +178 across 3 files. View PR surface stats
Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the pre-await generation fence and land only after a maintainer reviews the exact head with the required Codex source contract and normal merge gates available. Do we have a high-confidence way to reproduce the issue? Yes, from source: a wake can await runtime loading while requester yield installs a newer generation; the added composition test encodes that ordering. The reported direct-AWS reproduction was not independently accessible here. Is this the best way to solve the issue? Yes for the identified race: fencing at the pre-await wake boundary prevents stale descendant inspection and deadline writes, whereas a downstream callback guard would leave the stale mutation path reachable. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e69c3df2361b. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
@clawsweeper review Run a fresh review for the current PR head |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Punchcard-Session: silver-valley-valley-dt
ee74ca5 to
fa6f97d
Compare
|
Merged via squash.
|
…cope * origin/main: fix(qa): report cleanup failures truthfully (openclaw#119727) fix: keep completed actions visible after settled finalization (openclaw#119726) fix(agents): rearm yielded requester wake (openclaw#119696) fix(diagnostics): preserve telemetry during service shutdown (openclaw#119705)
Punchcard-Session: silver-valley-valley-dt
Related: #110922
Related: #118703
Related: #92433
What Problem This Solves
Fixes a timing race where a parent agent could remain silent after all delegated subagents completed when a requester yield crossed child completion delivery.
The exact
subagent-fanout-synthesisQA lane completed both child tasks but never produced the parent's final synthesis.Root Cause
An alpha-child cleanup could admit a requester wake before
sessions_yield. While that wake awaited registry runtime loading, requester settlement replaced the row with a new yielded-batch generation. The stale alpha wake then adopted the newer generation, saw beta still settling, and persisted a 30-second defer. Beta cleanup correctly honored that durable deadline, delaying the only valid final wake.Why This Change Was Made
Requester wakes are now fenced to the rearm generation they admitted before their first await. A stale wake returns before descendant inspection or batch mutation when requester settlement has installed a newer generation.
Settlement still marks delivered or in-progress completions as requiring a visible reply after yield, but it schedules immediately only when every ended delivery is fully delivered. Mixed batches remain owned by the normal delivery cleanup boundary. Existing transport retry deadlines and descendant defers are unchanged.
User Impact
Parents resume once, promptly, after late subagent delivery completes instead of hanging or waiting on a stale 30-second deadline. Duplicate-wake protection and legitimate retry backoff remain intact.
Evidence
a3419d4a4b4c894b47a9273181735d091f4d502f.nextAttemptAt, and proves beta cleanup owns one immediate final wake.ee74ca5554f9d6e2be355353c3a196a206c36c6cpassedsubagent-fanout-synthesison direct AWS: Anthropic 3/3 and OpenAI 1/1; every report passed, every CLI exit was 0, and aggregate exit was 0.fa6f97d5fdcfaf34de8a765600a639f7e843266aadds only the test type narrowing required bycheck-test-types; its focused lifecycle file passes 10/10.bb1af235ea2822d7a40f75ef52e4d6a2cde84da2:codex-rs/core/src/agent/status.rs,session_prefix.rs,agent/control.rs,tools/handlers/multi_agents/wait.rs, andmulti_agents_spec.rsconfirm completed child final messages are surfaced to the parent and wait reports terminal status.git diff --check: passed.Punchcard-Session: silver-valley-valley-dt