refactor(setup): split setup steps and own keepalive processes - #1093
refactor(setup): split setup steps and own keepalive processes#1093bkudiess wants to merge 1 commit into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Codex review: found issues before merge. Reviewed August 6, 2026, 1:20 AM ET / 05:20 UTC. ClawSweeper reviewWhat this changesThis PR splits the Windows setup pipeline into per-step files, extracts setup-time WSL keepalive ownership, and updates associated tests and architecture documentation. Merge readinessKeep open. The refactor is blocked by a concrete P1: its moved fresh-WSL verifier omits current-main timeout and retry fixes, so resolving the dirty merge from the branch would restore slow-host setup failures. A maintainer must also explicitly choose the changed keepalive-start failure policy. Priority: P2 Review scores
Verification
How this fits togetherThe setup engine creates and validates an app-owned WSL gateway before handing its keepalive process to the tray application. Its verification steps determine whether a first-run gateway setup can safely continue on slower Windows hosts. flowchart LR
A[Setup configuration] --> B[WSL preflight]
B --> C[Create app-owned distro]
C --> D[Verify WSL2 and root readiness]
D --> E[Start setup keepalive]
E --> F[Tray keepalive handoff]
F --> G[Connected local gateway]
Decision needed
Why: This is an availability-policy change with a user-visible success-versus-failure outcome, not a mechanical extraction decision. Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Rebase the one-seam refactor onto current main, retain the current fresh-WSL readiness policy, and preserve hard failure for keepalive-start exceptions unless a maintainer explicitly approves the fallback. Do we have a high-confidence way to reproduce the issue? Yes. Source comparison gives a high-confidence path: a fresh WSL host that exceeds the branch's 15-second verification or single 30-second probe fails where current main waits and retries. Is this the best way to solve the issue? No. The refactor must first preserve current main's readiness behavior; the keepalive exception policy also needs explicit maintainer approval. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against cdcb74f44a21. 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 (8 earlier review cycles)
|
|
@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:
|
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.