Repository navigation
fix: resume unfinished tasks after Gateway restarts - #153243
Conversation
Recover interrupted parent turns regardless of subagent-result provenance. Settle interrupted children through normal completion and let the parent inspect retained state before continuing or replacing them. Remove automatic child relaunch and retry machinery, preserve existing receipt reconciliation, and fence cleanup against newer owners.
|
🦞👀 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 19, 2026, 8:00 PM ET / September 20, 2026, 00:00 UTC (Revision 2). ClawSweeper reviewWhat this changesResumes unfinished parent conversations after Gateway restarts, settles interrupted children through normal completion, and reconciles recovered replies without automatically relaunching children. Merge readiness✅ Ready for maintainer review The PR remains necessary: fetched main and v2026.9.5 retain the parent-recovery defect. No concrete introduced correctness or security blocker was found. Priority: P2 Review scores
Verification
How this fits togetherGateway restart recovery reads persisted conversations and delegated-task records to determine what work remains. It coordinates parent continuation, child settlement, final replies, and session cleanup. flowchart TD
A[Saved conversations and child runs] --> B[Gateway restart recovery]
B --> C[Check current execution ownership]
C --> D[Settle interrupted children]
C --> E[Resume unfinished parent]
D --> E
E --> F[Reconcile final reply receipt]
F --> G[Complete delivery and owned cleanup]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -1335, Tests -2474, Docs -21, Other -10. Total -3840 across 59 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep task continuation with the parent, using existing admission, durable completion receipts, and current-owner cleanup safeguards. Do we have a high-confidence way to reproduce the issue? Yes, from source: interrupt a parent turn started by a child result before its work finishes; current main can discard it based on announcement provenance. No runtime reproduction was executed during this read-only review. Is this the best way to solve the issue? Yes. The patch removes the incorrect provenance shortcut and consolidates child interruption into existing settlement, while preserving admission and final-delivery checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 2adc87245a5a. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
|
Merged via squash.
|
Recover interrupted parent turns regardless of subagent-result provenance. Settle interrupted children through normal completion and let the parent inspect retained state before continuing or replacing them. Remove automatic child relaunch and retry machinery, preserve existing receipt reconciliation, and fence cleanup against newer owners.
What Problem This Solves
Fixes: unfinished parent tasks stop after a Gateway restart when their latest turn was started by a subagent result.
User Impact
Interrupted parents continue with a restart notice and their existing transcript. Interrupted native children report back through normal completion; the parent can continue a retained child with
sessions_sendor assign replacement work. Children are no longer automatically relaunched. Existing cleanup, retention, permissions, and startup capacity limits remain in place.Why This Change Was Made
Remove the assumption that an announcement-triggered turn only delivers a report, and remove the separate child relaunch, acceptance, retry, and resumption-notice machinery. The parent owns finishing the user's request. A saved child notification joins its recovered parent's exact result instead of starting duplicate work, and progress alone does not count as the owed final reply.
Live execution and admission are revalidated under the terminal completion lock. Delivering an already-saved result remains independent of permission to mutate or clean its child session. Existing shutdown markers and legacy child launch receipts are reconciled without a schema change or new updater behavior.
Evidence
ba64ac34ac94e1f7046c3ce7736807d73b888c75: 164 passing checks, 50 skipped, no failures or pending checks. CI run.