Repository navigation
fix(gateway): recover cloud workers without blocking paired-node startup - #126641
Merged
Merged
Conversation
Resume exact provider operations and leases under closure-bound placement and session authority. Bound startup admission to the exact cloud setup worker and preserve enrollment leases across non-destructive shutdown cancellation.
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 20, 2026 10:50
Contributor
Author
|
Land-ready proof for head
Exact broad worker regression command: Exact fresh startup/paired-node/bootstrap proof: Exact additional checks: |
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 21, 2026
…tup (openclaw#126641) * fix(gateway): recover provisioning workers during startup Resume exact provider operations and leases under closure-bound placement and session authority. Bound startup admission to the exact cloud setup worker and preserve enrollment leases across non-destructive shutdown cancellation. * fix(gateway): preserve paired node startup recovery
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
Fixes an issue where operators restarting a Gateway with cloud workers still provisioning could encounter a startup deadlock: startup recovery waited for a worker node connection while startup admission rejected the connection needed to finish recovery. Interrupted or competing recovery could also replay the wrong owner, duplicate a provider lease, or destroy work belonging to a newer placement.
Preserves the authenticated, already-paired node startup reconnect shipped by #126601. Closed issue #125157 is rollout context only; this PR does not close, reopen, or claim to resolve that issue.
Why This Change Was Made
Startup admission now allows both existing authenticated paired-node reconnects and the exact first-time cloud-worker bootstrap handshake, while continuing to reject unrelated operator, browser, unpaired-node, raw-worker, and mixed-credential traffic. Worker recovery is owned by the existing session/placement/environment lifecycle boundaries: replay revalidates the exact session, placement generation, environment, owner epoch, and live authority; provider operations deterministically reuse their exact durable lease; cancellation and shutdown fence/drain recovery without releasing a lease that remains eligible for replay.
The change introduces no SQLite schema-version change, Gateway protocol-version change, or new configuration surface. Production growth is intentional because exact startup admission, closure-bound lifecycle ownership, deterministic lease replay, and non-destructive cancellation are distinct missing capabilities/security invariants, not compatibility shims or downstream guards.
User Impact
Gateway restarts can finish recovering in-flight cloud workers without blocking startup, existing approved nodes keep reconnecting during startup, and interrupted/replayed provisioning resumes the correct lease without duplicating infrastructure or destroying a replacement session. Unauthorized or stale recovery attempts remain closed.
Evidence
Pre-fix sibling regression reproduced against the current-main behavior preserved by #126601:
The integrated worker/placement/provider regression suite passed 740 tests across 37 files and four Vitest shards:
The earlier combined startup proof passed 115 tests. An additional fresh exact-head real-Gateway/startup/bootstrap rerun passed 226 tests across 11 files and two Vitest shards:
Additional complete green verification:
Fresh independent autoreview: no actionable findings, overall confidence 0.88. Exact
origin/main...HEADchange accounting: production +985/-289 (net +696; 30 files); regression tests +2905/-41 (net +2864; 20 files); test support +23/-4 (net +19; 3 files); combined tests/test support +2928/-45 (net +2883; 23 files).Authenticated live team-environment recovery is intentionally deferred until after merge because deployment is outside this PR's authorization; no live deployment is claimed or performed.