Skip to content

feat(setup): install native Gateway automatically through WinGet - #1547

Merged
karkarl merged 3 commits into
openclaw:mainfrom
xlinush:xlinush-gateway-store-direct-launch
Sep 29, 2026
Merged

karkarl merged 3 commits into
openclaw:mainfrom
xlinush:xlinush-gateway-store-direct-launch

Conversation

@xlinush

@xlinush xlinush commented Sep 29, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Native Gateway setup now installs a missing Gateway package through WinGet rather than opening a Microsoft Store page and waiting for the user to click Install. This supersedes the earlier direct-Store-page implementation in this same PR, following the requested product change.

The native review explicitly explains that selecting Set up gateway authorizes installation and accepts the package and Store source agreements. Provider sign-in remains interactive.

Implementation

  • NativeGatewayMsixInstaller.InstallAsync uses the signed-in user's %LOCALAPPDATA%\Microsoft\WindowsApps\winget.exe alias through the existing CommandRunner, without a shell or elevation:
    winget install --id 9NV70LV3D6XC --source msstore --silent --accept-package-agreements --accept-source-agreements --disable-interactivity --no-upgrade
  • NativeGatewayPackageAcquisition still owns missing-package detection, one installation attempt and verified current-user registration/qualified aliases. Healthy existing Store or development packages skip installation; unhealthy or duplicate registrations remain explicit errors. WinGet success is not readiness.
  • Installation and verification retain the five-minute acquisition deadline. Both installation layers await cooperative cancellation cleanup before releasing setup ownership. Windows can still finish a deployment already submitted to its service; cancellation does not uninstall packages.
  • Missing WinGet, nonzero exit codes and timeouts show explicit retry/repair guidance with sanitized, bounded diagnostics. There is no automatic manual Store-page fallback.
  • Updated installation/verification progress, consent and cancellation copy in all six locales, associated tests and four architecture/setup docs.
  • Ownership remains with the existing installer/acquisition services. The page only supplies the runner and applies localized status; no new orchestration is added to App or ConnectionPage.

Required proof pools

  • windows-winui-interactive: native review consent and installation progress changed; current-code live consent UI inspected below.
  • windows-clean-installer-upgrade: real missing-package acquisition through the Store is not yet verified on a clean host.
  • windows-11-arm64: local native ARM64 build, isolated app launch and UI inspection passed; Store installation remains unverified.
  • windows-wsl-gateway-e2e: required gateway setup/connect regression proof passed locally.
  • windows-wsl-mxc: strict real Gateway to Windows node containment regression proof passed locally.

Validation

Validated source committed as a466f6d1 on Windows ARM64. OPENCLAW_REPO_ROOT pointed at this worktree; tray tests used isolated OPENCLAW_TRAY_DATA_DIR.

Command Result
.\build.ps1 Passed all five builds and documentation checks
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore 4168 passed, 34 skipped, 0 failed
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore 3185 passed, 0 failed
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore 1440 passed, 1 skipped, 0 failed
Installer/acquisition focused tests 28 passed, including cancellation/deadline cleanup ordering
NativeGatewaySetupUxContractTests 15 passed, including six-locale consent/progress contracts
.\scripts\validate-mxc-e2e.ps1 -NoBuild Recovered completed TRX: 17 passed, 0 skipped/failed; required live port, sandbox execution and protected-write tests all passed; fixture teardown completed

An earlier Shared run failed Dispose_DuringInFlightHandler_DoesNotSurfaceObjectDisposedException; its focused rerun passed and the full build/Shared/Tray/SetupEngine validation was rerun successfully. No unrelated production code was changed.

Rubber-duck review (gpt-6-astra) identified cancellation wrappers potentially abandoning installer cleanup. Both wrappers were removed, deterministic gated-cleanup tests were added, and the focused reviewer recheck reported no actionable findings. python .\.agents\skills\autoreview\scripts\autoreview --mode commit --commit HEAD refused the final bundle as secret-like content before invoking its engine. No clean result from that helper is claimed.

Real behavior proof

Current-code native review UI

Launched the current ARM64 build with .\run-app-local.ps1 -NoBuild -Isolated -AllowNonMain -Wait, confirmed the process was responsive and belonged to this worktree, then used Windows UI Automation to navigate Security notice > Native Gateway > Capabilities > Permissions > Review. Stopped before invoking installation and closed the isolated proof app afterward.

Copied live UI diagnostics from the changed review state:

ControlType.Text | GatewayTitle | Install a local native gateway | enabled=True
ControlType.Text | StepTitle | Ready to set up your native gateway | enabled=True
ControlType.Text | | By selecting Set up gateway, you authorize WinGet to install the missing Gateway package from Microsoft Store and accept the package and Store source agreements. Companion then verifies the package, prepares a dedicated profile, and opens Gateway setup. Provider sign-in stays interactive. This path does not install WSL, Local AI, or Tailscale. | enabled=True
ControlType.Button | PrimaryButton | Set up gateway | enabled=True

This proves the current consent UI, not completed installation or installation-progress behavior. Old screenshots of the manual Store-page handoff were removed because that behavior is no longer the implementation.

WinGet discovery

The exact current-user WinGet alias reports v1.30.150-preview; its help lists all requested installation flags. A non-installing query succeeded:

winget show --id 9NV70LV3D6XC --source msstore --accept-source-agreements --disable-interactivity
Found OpenClaw Gateway [9NV70LV3D6XC]
Publisher: OpenClaw Foundation
Installer Type: msstore
Store Product Id: 9NV70LV3D6XC

Not verified / blocked

  • Successful unattended Store installation on a clean host, followed by registration verification and automatic continuation, is not verified. This shared host already has development package OpenClaw.Gateway version 0.0.0.1; installing the Store package alongside it would create duplicate registrations. Existing installation was left untouched.
  • Current installation and verification progress states, real missing-WinGet/policy failures, and cancellation during actual Store deployment are covered by source/unit contracts but were not exercised against a live install.
  • The WSL/MXC E2E result is regression proof, not proof of the new native WinGet installation path. No new MCP/node command is introduced.

…isting

The native Gateway setup opened https://apps.microsoft.com/..., which lands
in the browser first. Launch ms-windows-store://pdp/?ProductId=9NV70LV3D6XC
so the Store app opens directly, falling back to the web listing only when
the Store protocol has no handler.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Sep 29, 2026
@clawsweeper

clawsweeper Bot commented Sep 29, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed September 29, 2026, 5:58 PM ET / 21:58 UTC (Revision 6).

ClawSweeper review

What this changes

Native Gateway setup now invokes WinGet to install a missing Microsoft Store package after review consent, then verifies registration before continuing onboarding.

Merge readiness

⛔ Blocked before merge - 6 items remain

This PR remains useful: current main opens a Store listing, while the branch attempts automatic installation. Before merge, the native setup path needs an in-product recovery route when WinGet is unavailable and proof that a missing package installs and setup continues.

Priority: P0
Reviewed head: a466f6d1c20b19528f998887d9ecd80ae03a1d2d
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦪 silver shellfish (2/6) Focused code and tests support the design, but the new installation path lacks live completion proof and the WinGet failure path can block onboarding.
Proof confidence 🦪 silver shellfish (2/6) Needs stronger real behavior proof before merge: Current-head live UI output shows the changed consent screen, and a non-installing WinGet query finds the product. The PR body expressly leaves the changed installation, registration, and automatic continuation path unverified; a redacted clean-host terminal trace or recording of that path is needed before merge. Updating the PR body should trigger re-review; otherwise a maintainer can comment @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Patch quality 🦐 gold shrimp (3/6) 1 actionable review finding remain.

Verification

Check Result Evidence
Real behavior Needs proof Needs stronger real behavior proof before merge: Current-head live UI output shows the changed consent screen, and a non-installing WinGet query finds the product. The PR body expressly leaves the changed installation, registration, and automatic continuation path unverified; a redacted clean-host terminal trace or recording of that path is needed before merge. Updating the PR body should trigger re-review; otherwise a maintainer can comment @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
Evidence reviewed 6 items Introduced install path: The PR replaces the Store-page launch with a fixed-product WinGet invocation and no Store-page fallback.
Current-main behavior: Current main opens the Store listing for a missing package; it does not perform the proposed WinGet installation.
Existing setup provenance: The merged native onboarding implementation introduced the existing package acquisition and Store handoff.
Findings 1 actionable finding [P1] Preserve an in-product route when WinGet cannot start
Security None None.

How this fits together

Companion's native Gateway onboarding checks the signed-in user's Windows package registration. If the Gateway is missing, package acquisition runs before profile preparation and the shared Gateway setup wizard.

flowchart LR
A[Native setup review] --> B[Package check]
B --> C{Gateway installed?}
C -->|Yes| F[Verify registration and aliases]
C -->|No| D[WinGet installation]
D --> F
F --> G[Prepare profile]
G --> H[Gateway setup wizard]
Loading

Decision needed

Question Recommendation
Should native onboarding retain an in-product Store installation route when WinGet is missing or blocked? Retain recovery: Offer a visible Store installation action on WinGet failure while keeping automatic installation as the normal path.

Why: The branch deliberately removes the prior handoff, but the discussion does not establish that blocking those existing setups is an accepted upgrade tradeoff.

Before merge

  • Add real behavior proof - Needs stronger real behavior proof before merge: Current-head live UI output shows the changed consent screen, and a non-installing WinGet query finds the product. The PR body expressly leaves the changed installation, registration, and automatic continuation path unverified; a redacted clean-host terminal trace or recording of that path is needed before merge. Updating the PR body should trigger re-review; otherwise a maintainer can comment @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • Preserve an in-product route when WinGet cannot start (P1) - The fixed WinGet alias can be absent or blocked. In that case CommandRunner returns a failure, and this new path only advises repair and retry; it no longer opens the Store listing that existing native setup used. Provide a visible recovery action so a first-time user can continue without external repair steps.
  • Resolve merge risk (P1) - A user without a working WinGet alias can no longer use the existing Store-page handoff; native onboarding ends with repair guidance and Retry setup, without an in-product installation route.
  • Resolve merge risk (P1) - The changed missing-package installation path has not been observed on a clean host through package registration and automatic continuation.
  • Complete next step (P2) - Resolve the WinGet failure recovery path and add current-head clean-host installation proof through verified continuation before merge.
  • Resolve maintainer decision - Resolve the maintainer decision shown above before merge.

Findings

  • [P1] Preserve an in-product route when WinGet cannot start — src/OpenClaw.SetupEngine/NativeGatewayMsixInstaller.cs:18-29
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and test delta production +75/-50 lines; tests +245/-37 lines The added tests cover command and cancellation contracts, while the new installation path still needs live completion proof.

Merge-risk options

Maintainer options:

  1. Restore an in-product recovery action (recommended)
    Keep WinGet as the default and let users open the Store installation path when WinGet cannot run.
  2. Accept the new prerequisite
    Explicitly approve WinGet availability as a native onboarding requirement and document the affected upgrade path.

Technical review

Best possible solution:

Keep automatic installation after consent, add a visible Store or App Installer recovery action for WinGet failures, and demonstrate a clean-host install through verified registration and wizard continuation.

Do we have a high-confidence way to reproduce the issue?

Not applicable to the feature request. Source inspection establishes the conditional WinGet failure path, but no live missing-WinGet or clean-install run was supplied.

Is this the best way to solve the issue?

Unclear. Automatic installation fits the expressed direction, but removing the prior in-product handoff leaves a recoverability gap when WinGet cannot run.

Full review comments:

  • [P1] Preserve an in-product route when WinGet cannot start — src/OpenClaw.SetupEngine/NativeGatewayMsixInstaller.cs:18-29
    The fixed WinGet alias can be absent or blocked. In that case CommandRunner returns a failure, and this new path only advises repair and retry; it no longer opens the Store listing that existing native setup used. Provide a visible recovery action so a first-time user can continue without external repair steps.
    Confidence: 0.9

Overall correctness: patch is incorrect
Overall confidence: 0.88

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 244f684ef291.

Labels

Label changes:

  • add P0: On affected first-run native setups, a missing or blocked WinGet alias leaves no in-product path to install the Gateway.
  • add merge-risk: 🚨 compatibility: The PR removes the existing Store-page route, so users whose WinGet installation fails may lose a working onboarding path.
  • add rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • add status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Current-head live UI output shows the changed consent screen, and a non-installing WinGet query finds the product. The PR body expressly leaves the changed installation, registration, and automatic continuation path unverified; a redacted clean-host terminal trace or recording of that path is needed before merge. Updating the PR body should trigger re-review; otherwise a maintainer can comment @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦪 silver shellfish, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: 📣 needs proof.
  • remove P2: Current review triage priority is P0, so this older priority label is no longer current.
  • remove proof: 📸 screenshot: Current real behavior proof evidence kind is live_output.
  • remove proof: sufficient: Current real behavior proof status is insufficient, not sufficient.

Label justifications:

  • P0: On affected first-run native setups, a missing or blocked WinGet alias leaves no in-product path to install the Gateway.
  • merge-risk: 🚨 compatibility: The PR removes the existing Store-page route, so users whose WinGet installation fails may lose a working onboarding path.
  • rating: 🦪 silver shellfish: Overall readiness is 🦪 silver shellfish; proof is 🦪 silver shellfish and patch quality is 🦐 gold shrimp.
  • status: 📣 needs proof: The PR needs real behavior proof before ClawSweeper can clear the contributor ask. Needs stronger real behavior proof before merge: Current-head live UI output shows the changed consent screen, and a non-installing WinGet query finds the product. The PR body expressly leaves the changed installation, registration, and automatic continuation path unverified; a redacted clean-host terminal trace or recording of that path is needed before merge. Updating the PR body should trigger re-review; otherwise a maintainer can comment @clawsweeper re-review. No stored-data contract changes. After adding proof, update the PR body; ClawSweeper should re-review automatically. If it does not, the PR author or someone with repository write access can comment @clawsweeper re-review.

Evidence

What I checked:

  • Introduced install path: The PR replaces the Store-page launch with a fixed-product WinGet invocation and no Store-page fallback. (src/OpenClaw.SetupEngine/NativeGatewayMsixInstaller.cs:18, a466f6d1c20b)
  • Current-main behavior: Current main opens the Store listing for a missing package; it does not perform the proposed WinGet installation. (src/OpenClaw.SetupEngine/NativeGatewayMsixInstaller.cs:18, 244f684ef291)
  • Existing setup provenance: The merged native onboarding implementation introduced the existing package acquisition and Store handoff. (src/OpenClaw.SetupEngine.UI/Pages/NativeGatewaySetupPage.xaml.cs:93, dba81213371c)
  • Release boundary: The latest stated release tag predates the native installer file; the proposed WinGet behavior is not established as shipped. (3c43751b2bac)
  • Proof scope: The captured PR body provides current-head native review UI output and a non-installing WinGet product query. It explicitly says a clean-host installation, registration verification, and automatic continuation were not verified. (a466f6d1c20b)
  • Product discussion: A contributor asked whether setup should install the package automatically; the subsequent branch revision implements that direction. The discussion does not explicitly accept removal of the manual recovery path.

Likely related people:

  • Karen: Raw commit dba8121 adds src/OpenClaw.SetupEngine.UI/Pages/NativeGatewaySetupPage.xaml.cs:93 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: dba81213371c; files: src/OpenClaw.SetupEngine.UI/Pages/NativeGatewaySetupPage.xaml.cs)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Show a redacted clean-host WinGet installation trace through verified registration and automatic wizard continuation.
  • Add an in-product recovery action for a missing or blocked WinGet alias, or obtain explicit maintainer acceptance of that prerequisite.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (5 earlier review cycles)
  • reviewed 2026-09-29T20:05:06.737Z sha df45508 :: needs real behavior proof before merge. :: none
  • reviewed 2026-09-29T20:27:37.515Z sha df45508 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T20:48:11.699Z sha df45508 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T21:03:35.963Z sha 09475d1 :: needs maintainer review before merge. :: none
  • reviewed 2026-09-29T21:13:34.301Z sha 09475d1 :: needs maintainer review before merge. :: none

@xlinush
xlinush marked this pull request as ready for review September 29, 2026 20:22
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Sep 29, 2026
@paulcam206

Copy link
Copy Markdown
Collaborator

are we intentionally choosing not to automatically install the gateway package? I assume we'd have a route to do that if we so desired...

@karkarl karkarl added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 29, 2026
Describe fallback on a false launch result rather than only a missing protocol handler. Runtime behavior is unchanged.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 8e02684c-6deb-4702-9f2a-f25f5c6bfc7b
@karkarl karkarl added status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. and removed status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. labels Sep 29, 2026
Replace the manual Store handoff with fixed-product noninteractive installation after review consent. Preserve package readiness checks, explicit errors, bounded cancellation, and awaited installer cleanup.

Co-authored-by: Copilot App <[email protected]>
Copilot-Session: 8e02684c-6deb-4702-9f2a-f25f5c6bfc7b
@karkarl karkarl changed the title fix(setup): open Gateway Store product page directly instead of web listing feat(setup): install native Gateway automatically through WinGet Sep 29, 2026
@karkarl karkarl removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Sep 29, 2026
@clawsweeper clawsweeper Bot added P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal priority bug or improvement with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. labels Sep 29, 2026
@karkarl

karkarl commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

Manually verified the installation flow with the updated winget install

@karkarl
karkarl merged commit 6bcc68c into openclaw:main Sep 29, 2026
30 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. P0 Emergency: data loss, security bypass, crash loop, or unusable core runtime. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants