Repository navigation
refactor(setup): split setup steps and own keepalive processes - #1093
Conversation
|
Codex review: found issues before merge. Reviewed August 18, 2026, 7:17 PM ET / 23:17 UTC. ClawSweeper reviewWhat this changesThe PR splits Setup Engine steps into focused files and moves setup-time WSL keepalive process ownership into a dedicated manager. Regression provenancePossible regression — suspected (reviewed change). No predecessor PR is attributed. Merge readinessKeep open. The head preserves fresh-WSL retry behavior, but changes a thrown keepalive launch error from a retrying setup failure into successful setup; that availability policy needs explicit approval or restoration of current behavior. Priority: P1 Review scores
Verification
Live VerificationCommand: Result: FAIL (failed) — execution before step 1 Assertions:
How this fits togetherThe Setup Engine provisions an app-owned WSL gateway and starts a temporary keepalive process so the tray can take over after setup. Pipeline results feed into gateway startup, pairing, and the tray restart path. flowchart LR
A[Setup configuration] --> B[Setup pipeline]
B --> C[WSL distro creation]
C --> D[Temporary keepalive manager]
D --> E[Gateway startup and pairing]
E --> F[Tray keepalive handoff]
Decision needed
Why: Current main and the PR head implement different user-visible failure semantics, and neither the supplied discussion nor repository policy records a maintainer-approved choice. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep the ownership transfer, but retain the established launch-exception retry/failure behavior unless a maintainer explicitly approves soft success as the permanent availability policy. Do we have a high-confidence way to reproduce the issue? Yes. Source comparison shows that current main lets a thrown Process.Start error enter normal pipeline retry/failure handling, while this head catches it and returns success. Is this the best way to solve the issue? No. For a refactor claiming preserved retry behavior, preserving the current exception path is the narrowest solution unless a maintainer deliberately chooses the new policy. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 99730e7569fc. LabelsLabel 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
HistoryReview history (18 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review Evidence update: two independent full-diff reviewers were asked for an explicit numeric confidence (not a qualitative 'clean') covering split fidelity, the KeepaliveProcessManager/SetupContext boundary, the policy-free runtime seam, the EnumerateProcessIds disposal fix, rollback kill-identity, and deterministic test coverage. Claude Opus 4.8: 97% confidence, zero accepted findings. GPT-5.6 Terra: 98% confidence, zero accepted findings. Neither found any real secret in the four bundler-flagged step files. PR body updated with this evidence. The one remaining before-merge item (thrown keepalive-start exception soft-succeeding setup) is an intentional, binding availability-policy decision requested during this PR's development, not a code defect -- documented in a new 'Maintainer decision needed' section in the PR body. Requesting a fresh review pass to reflect the added confidence evidence; the availability-policy choice itself still needs explicit maintainer sign-off before merge. |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]> Copilot-Session: 61934333-9a0d-4743-b5e1-cc62b0f65570
8f6c07f to
83220f2
Compare
Current-head validation and sanitized full setup proofValidated pushed head Validation
The current-head UI run completed the entire authorized real setup flow on Windows ARM64. The product-owned All screenshots below are cropped to the application window. The device identity in the final diagnostic view is covered by an opaque redaction. The install-plan screenshot was excluded because it displayed a local user-profile path. Real WSL replacement and setup pipelineGateway installed and ready for onboardingEntire setup completedCompanion relaunched and connectedGateway connected and node activeThe final state shows the local gateway connected at |





Summary
SetupSteps.csgod file into one file per step without changing pipeline order, IDs, retry, rollback, journal, logging, or WSL argv behavior.KeepaliveProcessManager.StartKeepaliveStepas the thinSetupContextadapter and result mapper.IKeepaliveProcessRuntimeseam for deterministic process identity, start, enumeration, kill, and failure tests.ShellEscapeclosure guard to every production file and route the two newly exposed Tailscale copies through canonicalWslShellQuoting.Ownership transfer
StartKeepaliveStepinline process, marker, identity, and rollback logicKeepaliveProcessManagerProcessand CIM mechanics inside the stepIKeepaliveProcessRuntime/ProcessKeepaliveRuntimeSetupSteps.csSetupStepFactory.BuildDefaultSteps()remains authoritative and unchangedWslGatewayKeepAliveService, managed-local repair,WslShellClient,GatewayConfigScriptBuilder, Tailscale step grouping, setup schema, CLI, and UI behavior are unchanged.Validation
./build.ps1: all 5 projects passedReal behavior proof
OPENCLAW_RUN_E2E=1SetupAndConnectTests: 16/16 passed with no skips.OpenClawE2E-*distro and setup-time keepalive process.OpenClawGatewaydistro, marker, and keepalive processes remained unchanged.validate-wsl-gateway.ps1 -Scenario UpstreamInstallwas additionally attempted twice but blocked before setup because the script still targets removedSetupWarningPage/OnboardingSetupLocalautomation IDs. Current onboarding usesWelcomePage,WelcomeInstallLocalGatewayChoice, andWelcomeNextButtonafter Standardize onboarding gateway choice on ListView pill selector #1048. The failed isolated runs left the shared distro, marker, and processes unchanged.PreflightOnlydoes not exercise setup/keepalive, so it was not reported as substitute proof.Review
Architecture
Adds authoritative
setup-keepalive-process-managerownership and strengthens the existingsetup-shellescape-closedguard. The remaining shared helpers stay inSetupSteps.csonly when used by multiple step files.