Repository navigation
refactor(gateway): share outbound recovery scheduling - #159096
Merged
Merged
Conversation
Contributor
|
🦞👀 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. |
steipete
enabled auto-merge (squash)
September 26, 2026 18:34
This was referenced Sep 26, 2026
This was referenced Sep 26, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Sep 27, 2026
This was referenced Sep 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Pending outbound delivery recovery arms a private interval outside the Gateway schedule.
User Impact
The first recovery remains eager. Later retries keep the five-second cadence, coalesce late wakes, and stop with the Gateway while admitted recovery settles. Queue persistence, captured state roots, delivery authority and backoff decisions stay with their existing owners. Existing state, configuration, spools and ports need no migration.
Why This Change Was Made
Pass the required kernel scheduler into recovery and return its existing in-flight promise to the scheduled job. Delete the interval, unref and clearInterval plumbing. One scheduler instance per Gateway process, enforced by types; no standalone instance or optional fallback is added. No storage schema, retention, config, SDK or RPC contract changes.
Production +13/−6/net +7; tests +35/−12/net +23; docs +0/−0/net 0. The small increase makes the existing recovery completion visible to scheduler shutdown.
Evidence
Blacksmith-testbox lease
tbx_01m3fe5xws0vqv7gvgg8bg9q61, run 36261201574, frozen install, base41324a0f2562c7998abe0152aa9b3be20bf0e4de, verified candidate tree7955c94c3577f1c0d10021fd9fcdd040e75b115a: all three candidate file runs passed, 44 cases and 36.941s command wall. Every command usedpnpm test <file> --maxWorkers=1, with source verification before and after.src/gateway/server-runtime-services.test.tssrc/gateway/server-runtime-services.delivery-recovery.test.tssrc/gateway/server-runtime-services.heartbeat-lifecycle.test.tsThese are command costs, not a performance comparison. Existing native persistence/worker setup accounts for the baseline above 30 seconds. The regression advances the shared injected clock by three minutes and observes one recovery, then verifies lifecycle stop prevents further retries. No new Gateway boots, wall-clock sleeps or per-file clock implementations were added.
Independent Codex P2 review is clean; deslop and six-root caller closure passed. The publication rebase preserves this reviewed patch and main's post-ready cutover. The measurements above belong to the pinned proof composition; GitHub's enforced
openclaw/ci-gatevalidates the published head instead of a separate Testboxcheck-changed. Final merged-main live proof follows the stack.Scheduler stack
Published predecessors: diagnostic preparation #157517, auth naming #158275, scheduler owner #158423, event-loop health #158531, channel health #158537, mention expiry #158614, upstream monitoring #158617, worker placement #158662, idle work #158666, Incognito expiry #158690, OAuth maintenance #158717, lifetime maintenance #158727, worker reconciliation #158812, PR subscriptions #158821, update checks #158909, Gmail renewal #158913, metadata #158959, and audit #158982.
Task maintenance is merged as #159038; generation #159042 and post-ready #159047 are also merged. Approval deadlines #159081 are merged. Cold storage is #159088. Remaining reviewed owners land separately; final merged-main Gateway/cron/suspend/shutdown proof follows the stack.
This PR migrates outbound recovery. Next are session delivery, update watcher and update campaign; their prepared proof has passed. Cron timing, periodic/media work, diagnostic/SDK and MCP lifetime cutovers, and final census/docs remain. Final Gateway/cron/suspend/restart/shutdown proof runs on merged main.