Repository navigation
fix: notify parents when child runs die in a Gateway crash - #206437
Conversation
Restart registry maintenance and schedule orphan settlement after requester custody is recovered. Record the crash interruption without waiting for another child reply, preserving existing terminal reply evidence. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 96d9a1b1-4a19-4d2c-88bc-ca144acbdc4b
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Codex review: passed. What this changesThe PR schedules restored child settlement and supplies terminal reply evidence so waiting parents receive interruption notices. Example: A parent yields while its child runs a timer, then the Gateway receives SIGKILL and restarts with the same state.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current crash-recovery gap using existing owners, with no actionable introduced defects found; current-head CI remains pending. Reviewed head: Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe subagent registry restores persisted child records and passes interrupted executions through the existing completion and requester-delivery owners. flowchart TD
A[Gateway restart] --> B[Restore child records]
B --> C[Activate registry sweeper]
D[Fresh requester admission] --> C
C --> E[Settle interrupted child]
E --> F[Completion owner]
F --> G[Notify waiting parent]
Technical reviewBest possible solution: Land the existing-owner scheduling and terminal-evidence fix once current-head required checks pass. Do we have a high-confidence way to reproduce the issue? Current-main source confirms the missing scheduling paths and matches the reported child-timer, parent-yield, SIGKILL, and same-state restart reproduction; this review executed no target code. Is this the best way to solve the issue? The change restores scheduling through the existing sweeper and completion owner while preserving admission, saved replies, and the prohibition on replaying dead child execution. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against bfc254339d38. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +12, Tests +133. Total +145 across 4 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReviewed November 27, 2026, 4:32 AM ET / 09:32 UTC (Revision 3). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
The restart sweep now excludes executions recorded in the current Gateway lifecycle, even when their wall-clock creation time precedes process startup. Keep repeated activation and the existing overlap assertions intact. Co-authored-by: daniel-lxs <[email protected]>
Worked on by: - @daniel-lxs Co-authored-by: daniel-lxs <[email protected]> OpenClaw-Publication: 12f8fe48-a990-4aad-873e-b91eb4da2a67
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Schedule settlement for restored child runs so yielded parents receive one interruption notice after a Gateway crash. Preserve saved replies and exclude children registered in the current Gateway lifecycle. (cherry picked from commit 78014c9)
…206437) Schedule settlement for restored child runs so yielded parents receive one interruption notice after a Gateway crash. Preserve saved replies and exclude children registered in the current Gateway lifecycle.
Schedule settlement for restored child runs so yielded parents receive one interruption notice after a Gateway crash. Preserve saved replies and exclude children registered in the current Gateway lifecycle. (cherry picked from commit 78014c9) Release adaptation: Keep the registry and settlement production hunks unchanged. Preserve the baseline restart fixture’s shutdown-completion path and add the timer only for the new cases. The graceful-shutdown notice uses the existing RESUMED parent response; the crash notice uses the existing new-input response. Both still require exactly one interruption notice, terminal delivered child state, and no child replay. Later 3ce0582 (collector replay ownership), a882e0f (saved replies for reused sessions), and f89ae43 (sweep ownership refactor) are not prerequisites for the existing owners. Later 82ddbf6 (shell restart recovery) and 26ff231 (shorter restart prompt) are independent restart fixture changes, not part of child crash settlement. Co-authored-by: RomneyDa <[email protected]>
Closes #206422
What Problem This Solves
A Gateway crash can leave a timer subagent marked running with delivery pending after restart. Its yielded parent gets no child-completion interruption, even though the child process is gone.
User Impact
Restart settles the original child as failed and tells its parent. Saved work remains available; child execution is not replayed. No configuration, schema, or permission changes are required.
Why This Change Was Made
I reactivated the existing registry sweeper after restoration and scheduled it when fresh requester custody resumes a dead child. Crash settlement also records an empty terminal reply, preserving any previously recorded terminal reply, instead of waiting for output from a dead executor. The existing completion and authorization owners remain responsible for delivery. Current-Gateway child runs are excluded from crash settlement by their recorded lifecycle identity, even if their wall-clock creation time predates process start.
Evidence
Current source and CI regression repair
0a8e37b7d5ccpassed 50/50, while PR head89cb1e7passed 43/50 and reproduced all seven 120-second overlap timeouts. Main · Failing PR.waitForDeliveredCleanup(second.runId). The immediate activation sweep treated a current-Gateway child with the fixture's old wall-clock timestamp as a crash orphan. I now exclude the current execution lifecycle using its existing recorded identity. The sweep still runs immediately; I changed no timeouts, existing fixture assertions, or execution authority.78327dfb46e05bba589ed76289fac308235792ba, tree5213fa036ee004c22ea1cb0a54e94272dc6a284a. Published head7b6ec6430b20951f80ad9163b293762bfa797c3fis a metadata-only publication commit with that identical tree.Earlier crash and live-model proof
fbba71f65223ewith a deterministic provider: the original run remainedrunning/pendingafter SIGKILL and same-state restart. Failing run. The original fix also passed 37 focused recovery, refusal, collector, and settlement tests.89cb1e7, the real OpenAI flow with an assistant-only observer confirmed the timer died, the original child becameterminal/ error with deliverydelivered, and the actual assistant repliedCRASH_NOTICE_RECEIVED25.2 seconds after restart began. Live PR proof. This supersedes the earlier reply-marker measurement, which could match the original user request.009566554a35left the dead childrunning/pendingafter 98.9 seconds with no child-interruption notice. Generic restart recovery let the parent inspect the dead PID itself, so this proves missing child completion, not complete parent silence. Live main reproduction.Review and limits
Hosted review passed on the earlier head
89cb1e7with no findings. Local autoreview of the correction could not execute in its required read-only sandbox; I did not broaden permissions. Full CI, fresh hosted review, a real-model rerun on the corrected tree, and non-Linux behavior are not yet verified.Worked on by:
Work sessions
Linked for team reference; these sessions aren’t public.
Worked on by
🦞 Made with OpenClaw