Repository navigation
fix: resume tasks after deferred startup recovery - #165184
Conversation
Retain pending requester wakes through database startup and isolate failed requester cohorts without weakening ownership or cancellation checks. Co-authored-by: steipete <[email protected]>
Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: afcb2b20-cf2d-4500-af58-cad2b5562ce4
|
🦞👀 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 October 4, 2026, 7:14 PM ET / 23:14 UTC. ClawSweeper reviewWhat this changesThe PR preserves task-resumption requests while database startup inspection is pending and lets independent task groups recover when another group's result transfer fails. Merge readiness✅ Ready for maintainer review Keep open: current main still contains both recovery failure paths, and this PR provides a focused repair with no actionable correctness findings. Priority: P1 Review scores
Verification
How this fits togetherThe subagent registry tracks delegated tasks and returns completed results to their requesting session. After a Gateway restart, it restores those records and schedules the remaining continuation work. flowchart TD
A[Gateway restart] --> B[Restore task records]
B --> C[Recover requester groups]
C --> D[Check current ownership]
D --> E[Resume independent tasks]
D --> F[Retry retained transfers]
F --> D
E --> G[Continue requester session]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +108, Tests +435, Docs +9. Total +552 across 10 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Keep durable continuation custody with the existing registry owner while recovering independent groups without relaunching restored tasks. Do we have a high-confidence way to reproduce the issue? Yes, from source: pending inspection reaches the terminal wake-rejection path, and an initial requester-transfer rejection interrupts the current-main activation loop. Added regressions target both mechanisms; this review did not execute them. Is this the best way to solve the issue? Yes. The patch reuses existing durable mutations and retry scheduling while retaining ownership checks and preventing duplicate restored-run activation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 81fd86410e1e. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* fix: resume tasks after deferred startup recovery Retain pending requester wakes through database startup and isolate failed requester cohorts without weakening ownership or cancellation checks. Co-authored-by: steipete <[email protected]> * fix: resume tasks after deferred startup recovery Worked on by: - @steipete Co-authored-by: steipete <[email protected]> OpenClaw-Publication: afcb2b20-cf2d-4500-af58-cad2b5562ce4 --------- Co-authored-by: steipete <[email protected]>
Reuse the existing read-candidate owner so pending writable startup admission does not block independent recovery reads. Keep cold reads serialized with first creation and retain native custody through cleanup. Preserve the deferred-recovery contract from #165184 after #167515. Verify raw sharing fixture aftermath without recertifying foreign edits, and count initial authority reads across cold and prepared worker lanes. Restores the eight red-main cases identified by the stability campaign without changing schema, public contracts, or sharing policy.
Reuse the existing read-candidate owner so pending writable startup admission does not block independent recovery reads. Keep cold reads serialized with first creation and retain native custody through cleanup. Preserve the deferred-recovery contract from openclaw#165184 after openclaw#167515. Verify raw sharing fixture aftermath without recertifying foreign edits, and count initial authority reads across cold and prepared worker lanes. Restores the eight red-main cases identified by the stability campaign without changing schema, public contracts, or sharing policy.
What Problem This Solves
Tasks can remain stopped after a Gateway restart when database startup inspection is still pending or one child-completion group cannot transfer its retained result.
User Impact
Interrupted work keeps its resume obligation and retries automatically. A failed requester group no longer stops unrelated groups from recovering. Cancellation, supersession, and database/Gateway ownership checks remain intact. No configuration or schema migration is required.
Why This Change Was Made
Pending inspection is not a failed delivery: retain the existing wake, counters, and replay identity, then retry after 30 seconds. Startup activation isolates failed transfers and retries them under the original owner with existing 1-second exponential backoff capped at 30 seconds. Already-restored runs are not launched again.
Evidence
Measured with the repository test wrappers and one worker: final lifecycle/requester invocation 87.30 seconds total (file durations 18.93 seconds for 213 tests and 49.28 seconds for 28 tests); native custody/queued invocation 52.35 seconds total (file durations 44.66 and 5.04 seconds). The longer existing suites retain native persistence, cleanup, and replay ordering rather than replacing those contracts with mocks. Published CI run: 46 executed jobs passed, 8053 summed job-seconds across parallel workers, 429 seconds from first job start to final gate completion. These are full-workflow costs, not per-test or incremental costs; conditionally skipped jobs are excluded.
Worked on by
Work sessions
View the OpenClaw team session