Repository navigation
fix(gateway): prevent overlapping setup after wizard cancellation - #115856
Merged
Merged
Conversation
Co-authored-by: TheAngryPit <[email protected]>
Co-authored-by: TheAngryPit <[email protected]>
steipete
marked this pull request as ready for review
July 29, 2026 11:15
Contributor
Author
|
Merged via squash.
|
14 of 18 tasks
17 of 22 tasks
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Jul 30, 2026
…enclaw#115856) * fix(wizard): retain cancelled sessions until runner settles * fix(wizard): purge cancelled sessions after settlement * test(gateway): cover settled wizard replacement * test(gateway): split wizard cancellation e2e * test(gateway): fix wizard e2e env key types * fix(gateway): forward daemon choice through wizard RPC Co-authored-by: TheAngryPit <[email protected]> * test(gateway): harden wizard cancellation cleanup Co-authored-by: TheAngryPit <[email protected]> * chore: drop changelog edit (release generation owns it) --------- Co-authored-by: TheAngryPit <[email protected]>
This was referenced Oct 8, 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.
Related: #110545
Supersedes #110382 with full credit to @TheAngryPit, whose original commits and lifecycle design are preserved here. The hosted-exit containment portion landed separately in #115671 with contributor credit; this takeover carries the remaining maintainer-approved cancellation and protocol work onto current
main.What Problem This Solves
Fixes an issue where cancelling a Gateway-hosted setup wizard could release its single-wizard ownership while the underlying runner was still active and able to mutate setup state. Remote onboarding clients also could not pass the existing daemon-install choice through
wizard.start.Why This Change Was Made
Track the runner's actual settlement separately from its public cancelled or completed status. Cancelled sessions continue to own the wizard slot until the runner can no longer mutate state, then purge automatically. Add the maintainer-approved optional
installDaemonrequest field and forwardtrue,false, or omission unchanged without adding config, compatibility shims, or a protocol-version bump.The field remains camelCase in TypeScript and the generated Swift API. Existing clients remain valid because the field is optional.
User Impact
Cancelling remote onboarding no longer permits overlapping setup work. A replacement wizard is rejected until the cancelled runner settles, then a later start succeeds automatically. Trusted remote onboarding clients can explicitly choose whether that invocation installs the daemon, while omission preserves existing behavior.
Evidence
Exact submitted head:
346433c18d2e050f937f98d2950323cfa786865d.node scripts/run-vitest.mjs src/gateway/server-methods/wizard.test.ts src/gateway/server-wizard-sessions.test.ts: 14/14 passed.node scripts/run-vitest.mjs src/gateway/gateway-wizard-cancel.e2e.test.ts: 1/1 passed through an authenticated real Gateway WebSocket; cancellation blocked replacement until settlement, later replacement started, and Gateway health remained available.node scripts/run-vitest.mjs src/gateway/gateway.test.ts -t 'keeps the authenticated Gateway alive after': 4/4 passed for setup/channel exits with codes 0 and 23;process.exitwas untouched and the authenticated Gateway remained healthy.node scripts/run-vitest.mjs packages/gateway-protocol/src/index.test.ts: 57/57 passed.git diff --check: passed.patch is correct, confidence0.93). The accepted review findings were the generated Swift spelling and E2E cleanup scope; both were fixed at their owner boundaries and re-reviewed clean.The failed
Real behavior proofcheck on #110382 did not execute contributor code. Its log reports that a transient PR-body revision lacked authoredWhat Problem This SolvesandEvidencesections. Later checks on that same head passed after the body was restored. This takeover includes both required sections in its initial PR body.