Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: blocked before merge. What this changesAdds a tray CLI mode and launcher parameters that install and pair a WSL Gateway from a saved configuration without the wizard. Example: Run .\run-app-local.ps1 -Dev -SetupConfig .\my-setup.json.
Review scores
ProductKind: Feature · Worth it: Yes · Fix scope: Complete Merge readiness⛔ Blocked before merge - 1 item remains Keep this useful, maintainer-authored PR open. The previous findings are addressed, and no definite introduced defect remains; saved-state compatibility still needs validation. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe tray executable translates CLI options into the existing SetupEngine pipeline, which manages WSL installation, Gateway pairing, registry records, and Companion settings. flowchart TD
A[Saved configuration] --> B[Launcher or tray CLI]
B --> C[Startup and replacement admission]
C --> D[Profile and shared target locks]
D --> E[Existing SetupEngine pipeline]
E --> F[WSL Gateway and paired Companion state]
Technical reviewBest possible solution: Retain the focused CLI adapter and shared safety owners, then establish that upgrading an existing installation preserves its saved state. Do we have a high-confidence way to reproduce the issue? This is a feature request implemented by the patch; main lacks the executable dispatch, while the author's terminal trace demonstrates the earlier implementation installing and pairing a real WSL Gateway. Is this the best way to solve the issue? The patch reuses SetupEngine, startup readiness, WSL ownership, and migration admission rather than creating another installer; the added parsing and presentation seams serve distinct CLI and noninteractive contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 12789b405719. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed November 3, 2026, 6:46 PM ET / 23:46 UTC (Revision 3). |
|
Addressed Serialize replacement admission with the shared WSL operation (P1) in 10c0e92.
Tests: new Validation: Runtime proof:
Still open: the two P2 items (migration modal dialog, recovery instruction for unowned WSL state) and the data-model compatibility proof. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
343be69 to
d0f63f7
Compare
|
Rebased onto current origin/main (was Validation on the rebased head, worktree with
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
d0f63f7 to
634495e
Compare
| if (PackageHelper.IsPackaged) | ||
| return Fail(2, "Headless setup is not available in the packaged (MSIX) app. Run setup from the app instead."); | ||
|
|
||
| if (IsTrayRunning()) |
There was a problem hiding this comment.
Copilot triage: Could headless setup hold per-profile single-instance admission for the whole run, rather than only checking here? TryOpenExisting can return false, after which a normal tray can create its mutex and start on the same profile while the setup pipeline, including --replace-existing, changes the Gateway and distro. The shared-target setup lock serializes setup and uninstall, but does not stop normal tray startup. A concurrent-start regression would protect the no-running-tray invariant.
PR cleanup reviewReviewed head: Thanks for exposing the existing setup pipeline without creating a second installer. This still adds functionality that is absent from main, so I would keep it open rather than close it as superseded. The remaining startup race noted in the inline thread needs attention: headless setup checks for the tray mutex but does not hold admission, so normal startup can overlap a replacement run. Please retain admission for the run and cover both concurrent-start orders. After refreshing the branch, bind the full setup/pairing, migration refusal and existing-installation preservation evidence to the new head; the current reports reference earlier revisions. The current-head CI checks are green, which is useful evidence, but do not settle that race or the custom proof gaps. Action in this cleanup pass: leaving this PR open. No branch changes or runtime-proof waiver. The findings above come from source, discussion and recorded-CI review; Windows validation was not rerun in this pass. |
|
Hi @larroy, this is a Copilot triage agent (not Scott), doing an overnight sweep for PRs that could land. I made no changes to this branch. Thank you for exposing the existing setup pipeline headlessly, and for the replacement guard rails ( What I checked against current
This PR already carries "status: 👀 ready for maintainer look", so I left the labels alone. No pressure on timing. |
634495e to
396fb07
Compare
|
This pull request has been automatically marked as stale due to inactivity. |
Add a --headless-setup [--config <file>] [--force-setup] CLI mode to the tray executable that runs the SetupEngine pipeline without UI, using the app identity's data dirs, distro name and port. Setup is skipped when StartupSetupState.RequiresSetup reports the data dir is already configured. run-app-local.ps1 gains -SetupConfig and -ForceSetup to run that mode before launching the tray. It waits on the setup process only, because setup leaves a WSL keepalive running.
…consent Require --replace-existing before replacing an existing app-owned distro, its data, or a local gateway record, matching the setup window's replacement review. Refuse while a tray holds the mutex for the same data dir, honor the Inno completed-migration guard, run off the WinUI dispatcher, and exit on every failure path.
…t at cleanup SetupRunLock now also holds setup-target.lock in the shared local setup directory, so profiles with different OPENCLAW_TRAY_DATA_DIR values cannot run setup concurrently. Headless setup without --replace-existing passes --preserve-existing; the engine re-checks existing state under the lock, and CleanupStaleDistroStep refuses to remove any distro.
…SL state Headless setup no longer opens the migration guidance dialog. The Inno migration decision moves to InnoMigrationStartupAdmission (OpenClaw.Connection), InnoMigrationStartupGuard.TryGetStopGuidance returns the guidance key without UI, and CliSetupHandler prints the localized text to stderr with exit code 2. Headless setup is refused in the packaged app and now dispatches before the window-presenting Store migration guard. A distro or distro data not proven to be app-owned is never replaced headlessly, even with --replace-existing. The refusal says the target was preserved and points to interactive setup or manual removal.
396fb07 to
de4e4ca
Compare
What Problem This Solves
Setting up a local WSL gateway always requires clicking through the setup wizard, so developers and scripts cannot reproduce a gateway install from a saved set of options.
User Impact
User impact: developers can run
.\run-app-local.ps1 -SetupConfig .\my-setup.json(orOpenClaw.Tray.WinUI.exe --headless-setup --config <file>) to install and pair the WSL gateway with no UI, then start the tray already connected. Reruns skip setup when the data directory is already configured.Setup refuses to replace an existing app-owned distro, its data, or a local gateway record unless
--replace-existing(-ReplaceExisting) is passed.-Isolatedand-DataDirdo not isolate the WSL distro, so without that flag a fresh isolated profile could otherwise delete the distro used by the normal profile. The native MSIX gateway route stays interactive. No change to the normal tray launch or the setup window.Why This Change Was Made
The headless SetupEngine pipeline already exists and is what the E2E tests use, but it has no executable of its own. This adds a
--headless-setupCLI mode to the tray executable, modeled on the existing--uninstallmode, and wires it intorun-app-local.ps1.The mode reuses the interactive setup's app-identity distro, port and data directories, and
StartupSetupState.RequiresSetupfor the skip decision, so "skipped" means the same as "the tray will not open setup". It applies the same safety rules as interactive setup:Behavior details
--headless-setup,--config <path>,--force-setup,--replace-existing. Anything else exits with code 2.default-config.json). ItsDistroNameandGatewayPortare ignored, as in the setup window. Capabilities are set underCapabilities, which overwritesSettings.Node*Enabled.Environment.Exit, so the windowless process cannot linger.run-app-local.ps1waits on the setup process withHandle+WaitForExit()instead ofStart-Process -Wait, because setup leaves a WSL keepalive descendant running.Evidence
OpenClawGateway-Dev, port 18790): all 34 pipeline steps succeeded, operator and node pairing were auto-approved, and the run ended withSETUP COMPLETE.Headless setup skipped: ... is already configured.and launched the tray. The tray log shows operatorhello-ok, thenNode registered successfullyandNode status: Connected, with no setup window.Change Type
Scope
winnodeRequired proof pools
windows-wsl-gateway-e2e: the change drives product WSL setup, bootstrap, and operator and node pairing through a new entry point.Validation
Commit
ca028205, worktree withOPENCLAW_REPO_ROOTset:./build.ps1: all builds succeeded; documentation validation passed (66 Markdown files).dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: Passed 4650, Skipped 24, Failed 0.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: Passed 4568, Failed 0. This includes the newCliSetupCommandLineTestsand the existing startup-order tests (InnoMigrationContractTests,InstallerIssAssertionTests).run-app-local.ps1guards (manual):-ForceSetupwithout-SetupConfigthrows.Setup config not found: ....-DryRunprints the setup config line and starts nothing.Real Behavior Proof
%TEMP%\oc-headless, Store Gateway (no dev gateway packaging).eb247fcd.ca028205.ca028205..\run-app-local.ps1 -Dev -DataDir $env:TEMP\oc-headless -UseStoreGateway -SetupConfig $env:TEMP\oc-setup.json(copy ofdefault-config.json).-NoBuild.OpenClaw.Tray.WinUI.exe --uninstall --confirm-destructive(exit 0, distro unregistered).ca028205source):Yes/No/N/A): N/A (terminal and log output only).ca028205. The first full run hung afterSETUP COMPLETEinrun-app-local.ps1(Start-Process -Waitwaiting on the keepalive). The fix was confirmed by the rerun path, not by a second full install.ExistingConfigDetector.Detect. After theTask.Runfix, one gate test without a config file ran the pipeline against a private temp local root and created a tempOpenClawGatewaydistro. I verified its base path was the temp root, then unregistered it. The user's distros were not touched.windows-wsl-gateway-e2epool has not run.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): YesYes/No): NoYes, explain the risk and mitigation:--headless-setup, uses the same distro ownership checks as the setup window, and refuses to replace existing state without--replace-existing. It also refuses while a tray for the same data dir is running, and honors the Inno completed-migration guard.Compatibility and Migration
Yes/No): YesYes/No): No. New optional CLI flags and script parameters only.Yes/No): NoReview Conversations