Repository navigation
fix(setup): retry wizard startup migration lease handoff - #1129
Conversation
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed August 8, 2026, 10:36 AM ET / 14:36 UTC. ClawSweeper reviewWhat this changesThe PR adds a bounded retry for the exact startup-migration lease diagnostic while the setup wizard restores Gateway reload mode, with focused regression tests. Regression provenancePossible regression — probable (failure trace; reviewed change). No predecessor PR is attributed. Merge readinessKeep open. Current main has a single restoration attempt, and the reported lease handoff is a plausible bounded reliability gap; this collaborator-authored PR also cannot be auto-closed. The supplied runtime proof does not show the new contention-retry path actually recovering in a real setup. Priority: P2 Review scores
Verification
How this fits togetherThe setup wizard temporarily disables Gateway reloads while applying configuration, then restores the configured reload mode and restarts the managed Gateway. A failed restoration leaves the completed wizard unable to safely hand back a usable Gateway. flowchart LR
A[Gateway wizard] --> B[Temporarily disable reload mode]
B --> C[Apply wizard configuration]
C --> D[Restore configured reload mode]
D --> E{Migration lease contention?}
E -->|Exact transient diagnostic| F[Bounded retry]
E -->|Other failure| G[Fail closed]
F --> H[Restart and verify Gateway]
G --> H
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the retry limited to the exact lease diagnostic and attach a redacted production-boundary trace showing contention, retry, restoration, one restart, and successful health verification within the 15-second budget. Do we have a high-confidence way to reproduce the issue? Yes, at source level. Current main makes one restoration attempt, and the PR body supplies a concrete base-SHA failure trace for the exact migration-lease diagnostic; the branch still needs a real after-fix contention recovery run. Is this the best way to solve the issue? Yes, conditionally. Retrying only the documented transient diagnostic is narrower and safer than weakening fail-closed restoration, provided the actual recovery path is demonstrated. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 9f9a8eda6340. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
The gateway tears down its in-process hosted wizard TUI when the configuration applied by the final wizard step restarts the gateway. Setup answered every step through the final `done` acknowledgement, then received a terminal payload whose error was exactly `Error: TUI exited from signal SIGTERM`, failed the run-wizard step, and issued a best-effort wizard.cancel against a gateway that was already restarting. Two independent Windows-node release-check lanes reproduced this after successful pairing, verify-e2e, reload-mode restoration, managed restart, health, and provenance checks. Accept that one terminal result as completion, and only that one. The payload must be terminal, the request just sent must have answered the authoritative final step (a plain acknowledgement note with no options whose id or title normalizes to `done`, last in order when the gateway supplies position metadata), and the error must equal the exact message apart from surrounding whitespace. Every other terminal error, an earlier SIGTERM, a progress poll, a replayed session, an answerable step, and a non-terminal payload keep the wizard failure and keep cancellation. Terminal-payload classification now goes through a pure decision seam, and the final-step flag is owned by a tracker, so the accepted path and each rejected path are directly testable. #1129 reload-mode restoration, its exact startup-migration-lease retry inside the 15 second deadline, cancellation and restoration ordering, and the one-shot managed restart are unchanged. Co-authored-by: Copilot App <[email protected]>
Summary
gateway.reload.modeafter the Gateway wizard.Failure evidence
9f9a8eda6340c7ec6f0acbc410de4f6b7d24a3cefrom ci: test exact Windows release artifacts against gateway candidate #1104.openclaw/openclaw#119762at96053618cf58626df109f537ca64dd5efb3ad376, pinned to that Windows node SHA.run-wizard.OpenClaw startup migrations are already running for this state directorywhile the restarting Gateway PID still owned the lease.Validation
dotnet format .\openclaw-windows-node.slnx --no-restore --include .\src\OpenClaw.SetupEngine\SetupWizardRunner.cs .\tests\OpenClaw.SetupEngine.Tests\SetupStepsTests.cs.\build.ps1: all projects built; documentation validation passed for 46 files..\scripts\validate-mxc-e2e.ps1without-AllowSkip: 17 passed, 0 failed, 0 skipped.Real behavior proof
The strict MXC run used an isolated
OpenClawE2E-*WSL distro and isolated tray data. Current-head output showed:The same run proved
mxc-direct-appc; contained=True,containment=mxcfor successful and denied-write paths, and 17/17 tests passed. No real user profile, credentials, firewall state, or unrelated process was mutated.Focused deterministic tests cover exact contention recovery, unrelated failure without retry, full-budget exhaustion preserving wizard plus restoration diagnostics, cancellation restoring before propagation, and one-shot restart ordering.
Hosted CI
89a04d544d0b49b855a35ef36b9476fc1418a6b0.SessionTitleBehaviorProofTeststimed out waiting forSessionsPageMarker, and setup-connect exceeded its 45-minute job timeout. The failed jobs were rerun on the same exact SHA without code changes; both passed on attempt 2.Reviews
origin/main: initial P2 finding about stopping before the 15-second deadline was accepted and fixed; final rerun reported no accepted or actionable findings with 0.95 confidence.