Skip to content

feat: add OpenClaw Gateway MSIX packaging - #1186

Closed
xlinush wants to merge 6 commits into
openclaw:mainfrom
xlinush:feat/gateway-msix-packaging
Closed

xlinush wants to merge 6 commits into
openclaw:mainfrom
xlinush:feat/gateway-msix-packaging

Conversation

@xlinush

@xlinush xlinush commented Aug 20, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

OpenClaw does not currently have a public, independently buildable MSIX path for packaging a pinned OpenClaw Gateway revision together with its Node.js runtime and a first-launch bootstrap experience.

What This Adds

This PR adds a standalone Gateway MSIX implementation under packaging/gateway-msix:

  • a .NET 10 NativeAOT bootstrap host for x64 and ARM64;
  • a pinned and hash-verified OpenClaw payload plus the matching official Node.js runtime;
  • transparent forwarding of every explicit command-line argument to the bundled OpenClaw CLI;
  • package-owned payload preparation, repair, and diagnostics;
  • unsigned, temporary test-signed, and policy-gated official-signing workflow modes;
  • immutable release-policy checks for official signing with Azure OIDC;
  • unit tests and public documentation for the host, staging, signing, and launch behavior.

The package is separate from the Companion application and uses the OpenClaw.Gateway package identity.

Runtime Behavior

Launching openclaw without arguments prepares the bundled payload under %USERPROFILE%\.openclaw-msix\app and offers fast or full verification. Preparation uses a temporary directory and atomic promotion, so an existing payload is replaced only after the new payload is extracted and verified. Explicit arguments are forwarded unchanged to the bundled openclaw.mjs; the host does not reserve, consume, reject, rewrite, or implement OpenClaw commands.

Every child process receives:

OPENCLAW_SUPERVISOR_MODE=external
OPENCLAW_NO_AUTO_UPDATE=1

These settings make the MSIX the owner of packaged code updates while leaving command behavior and enforcement to OpenClaw itself.

For first-run local setup, the documented command is:

openclaw setup --classic --mode local --no-install-daemon

Payload Integrity Boundary

The immutable payload archive inside the MSIX is hash-verified on launch. The prepared payload marker is then used to avoid re-hashing every extracted file during normal startup because complete per-file verification substantially delays launch. Users can explicitly request full verification and repair from the bootstrap menu.

The prepared directory is writable by the current user and is treated as user-owned application state, not as a tamper-resistant boundary against that same user context. The longer-term design is to run the Gateway payload in a dedicated isolated agent session rather than the interactive human session. That isolation is not part of this initial MSIX implementation.

Signing and Release Controls

Pull-request and push builds produce unsigned validation packages. Manual runs support:

  • unsigned: any branch, tag, or commit;
  • test: any ref, signed with a temporary runner-generated certificate;
  • official: only the immutable approved commit in release-policy.json, only from main, using the protected release-signing environment and Azure OIDC.

No signing private key is stored in the repository or uploaded as an artifact.

Current-Head Validation

Tested packaging head: fbc07162eb3409975d78a83c299f72fa0f428f5a

Bundled OpenClaw commit: 0790d9f593ad30c940ed93b5872a8cf6d6f3cf8c

  • ./build.ps1: passed. All repository projects built and documentation validation passed for 47 Markdown files.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: passed. 3,791 passed, 0 failed, 32 skipped.
  • dotnet test ./packaging/gateway-msix/OpenClaw.Gateway.MSIX.slnx --configuration Release --no-restore: passed. 42 passed, 0 failed, 0 skipped.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: blocked locally. The assembly started and discovered the test file but produced no results for ten minutes, reproducing the existing local hang.
  • Gateway MSIX signing-policy fixtures: passed.
  • Local x64 NativeAOT MSIX 0.1.13.0: built with 0 warnings and 0 errors and was test-signed successfully. SHA-256: AD6E06A64435F68A400CDBD99E9C634480063C8797092B16C107937FEE340155.
  • Current-head GitHub Actions execution: not available because this first-time-contributor workflow still requires upstream approval.

Windows Installation Proof

The following evidence was captured from the test-signed x64 package built from the current PR head, fbc07162eb3409975d78a83c299f72fa0f428f5a.

Tested package metadata:

  • Packaging commit: fbc07162eb3409975d78a83c299f72fa0f428f5a
  • Bundled OpenClaw commit: 0790d9f593ad30c940ed93b5872a8cf6d6f3cf8c
  • Architecture: x64
  • Package version: 0.1.13.0
  • Test-signed MSIX SHA-256: AD6E06A64435F68A400CDBD99E9C634480063C8797092B16C107937FEE340155

Artifact provenance and matching package hash

The generated metadata identifies the clean packaging commit, bundled OpenClaw commit, package version, signing type, and expected package hash. Get-FileHash independently reports the same SHA-256 for the tested MSIX.

Current-head MSIX provenance and matching SHA-256

Installed package identity

Windows reports the current package as OpenClaw.Gateway version 0.1.13.0, x64, installed under the packaged WindowsApps location with the expected OpenClaw Foundation publisher.

Current-head installed OpenClaw Gateway package identity

Windows command resolution

Both Get-Command openclaw -All and where.exe openclaw resolve the tested command to the packaged Windows App Execution Alias.

Current-head Windows openclaw command resolution

Real packaged CLI execution and argument forwarding

openclaw --version loads and verifies the packaged payload, forwards the explicit argument to the bundled OpenClaw CLI, reports bundled version 2026.7.1 (0790d9f), and observes child exit code 0. The final Press Enter to close this window... line also reproduces the outstanding review finding that explicit forwarded commands currently wait for an extra Enter.

Current-head packaged OpenClaw version execution and exit prompt

openclaw --help likewise reaches the bundled CLI and displays its real command and option output through the installed package.

Current-head forwarded OpenClaw help output

Compatibility and State Ownership

OpenClaw currently assumes one default openclaw command and one default state root per user. Multiple Gateway instances are supported only through explicit isolation with --profile or separate OPENCLAW_STATE_DIR, OPENCLAW_CONFIG_PATH, and port settings. This MSIX follows that existing single-default-install model rather than attempting to introduce a general side-by-side installation solution.

The package currently registers the openclaw.exe App Execution Alias. If maintainers require simultaneous npm/native and MSIX installations, the project needs an explicit product-level command-routing, state-isolation, upgrade, and uninstall contract. If only one default installation is supported, the alias should instead be reviewed as the intended replacement and servicing path.

The bootstrapper deliberately performs no Gateway shutdown or state deletion. OpenClaw shutdown and shared-state cleanup are delegated to the documented openclaw uninstall flow. Removing the MSIX may leave the prepared %USERPROFILE%\.openclaw-msix directory, which users can remove manually after OpenClaw is stopped.

Maintainer Decisions Requested

  1. Whether this standalone Gateway MSIX and official-signing path should be added while the existing release documentation keeps MSIX distribution paused.
  2. Whether the MSIX should own the global openclaw.exe alias or use a separate coexistence route.
  3. Whether the documented same-user staged-payload integrity boundary is acceptable for the initial release pending isolated agent sessions.

Change Type

  • Bug fix
  • Feature
  • Refactor
  • Docs or instructions
  • Tests or validation
  • Security hardening
  • Chore or infrastructure

Scope

  • Tray or WinUI UX
  • Windows node capability
  • Local MCP or winnode
  • Gateway, connection, or pairing
  • Setup or onboarding
  • Permissions, privacy, or security
  • Tests, CI, or docs

Review Conversations

  • I replied to or resolved every review conversation addressed by this PR.
  • Remaining unresolved conversations require maintainer product or ownership decisions described above.

Add an independent .NET 10 NativeAOT bootstrap host, pinned gateway payload workflow, x64 and ARM64 MSIX composition, protected Artifact Signing support, reset and repair UX, tests, and public documentation.

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

Copilot-Session: 44c67666-9bfb-4db1-bda6-becae62926cb
@clawsweeper

clawsweeper Bot commented Aug 20, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. P2 Normal priority bug or improvement with limited blast radius. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 20, 2026
@clawsweeper

clawsweeper Bot commented Aug 20, 2026 •

Copy link
Copy Markdown

Codex review: found issues before merge. Reviewed August 25, 2026, 5:32 PM ET / 21:32 UTC.

ClawSweeper review

What this changes

This PR adds a standalone Windows MSIX package that stages a pinned OpenClaw Gateway and Node runtime, forwards CLI commands, and adds build, signing, test, and documentation support.

Merge readiness

⚠️ Needs maintainer review before merge - 6 items remain

Keep open for maintainer product direction and two P1 fixes. The current release contract still pauses MSIX distribution, while this branch enables a separately signed Gateway package that also takes the established openclaw command and pauses explicit CLI invocations for input.

Priority: P2
Reviewed head: fbc07162eb3409975d78a83c299f72fa0f428f5a
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Current-head Windows proof is strong, but two P1 command-behavior defects and unresolved release direction prevent a merge-ready rating.
Proof confidence 🦞 diamond lobster (5/6) ✨ media proof bonus Sufficient (screenshot): Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.
Patch quality 🦐 gold shrimp (3/6) 2 actionable review findings remain.

Verification

Check Result Evidence
Real behavior Verified Sufficient (screenshot): Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.
Evidence reviewed 5 items Current release policy: The checked-in release contract says MSIX artifacts remain paused and may be re-enabled only with packaged consent validation and release coverage, whereas this PR adds an independent build and official-signing workflow.
Global command collision: The new package registers the global openclaw.exe App Execution Alias, while current architecture documentation describes the native Gateway path as npm install -g openclaw && openclaw onboard.
Explicit commands wait for input: The host unconditionally calls the exit prompt for every non-redirected console, including after a forwarded command has completed. The current-head proof in the PR body visibly shows this after openclaw --version.
Findings 2 actionable findings [P1] Preserve access to the established openclaw command
[P1] Skip the exit prompt for forwarded CLI commands
Security None None.

How this fits together

The proposed MSIX bootstrapper receives the Windows openclaw command, verifies and stages a bundled Gateway payload in the user profile, then launches the bundled Node CLI. A new GitHub Actions workflow builds payloads, packages both architectures, and can request official signing.

flowchart LR
  A[Windows openclaw command] --> B[MSIX bootstrapper]
  B --> C[Payload verification and staging]
  C --> D[User-scoped prepared payload]
  D --> E[Bundled Node runtime]
  E --> F[OpenClaw Gateway CLI]
  G[Build and signing workflow] --> H[MSIX artifacts]
Loading

Decision needed

Question Recommendation
Should OpenClaw introduce an independently signed Gateway MSIX distribution while the documented release policy pauses MSIX, and should that package replace or coexist with the established openclaw command? Retain the MSIX pause: Keep the documented distribution policy and do not land the independent signing path until release owners approve and define the required coverage.

Why: The branch intentionally creates a new distribution and signing route, while current release documentation explicitly pauses MSIX and existing users already rely on the native/npm command and shared state contract.

Before merge

  • Preserve access to the established `openclaw` command (P1) - This global alias can redirect users who already installed the documented npm command into the pinned MSIX runtime and shared state directory. Use a distinct command or an explicit, tested replacement and migration contract before registering this alias.
  • Skip the exit prompt for forwarded CLI commands (P1) - The finally block waits for input after every interactive invocation, including openclaw --version and failed commands. That blocks ordinary CLI use and scripts after the child has already exited; limit the prompt to the no-argument bootstrap flow.
  • Resolve merge risk (P1) - Merging creates an independently signable MSIX distribution path while the current release policy keeps MSIX distribution paused.
  • Resolve merge risk (P1) - The global App Execution Alias can redirect existing native or npm openclaw users into a pinned packaged runtime that shares their default OpenClaw state.
  • Resolve merge risk (P1) - Forwarded interactive CLI calls wait for Enter after the child exits, which can stall normal terminal use and automation.

Findings

  • [P1] Preserve access to the established openclaw command — packaging/gateway-msix/src/OpenClaw.Gateway.MSIXHost/Package.appxmanifest:48
  • [P1] Skip the exit prompt for forwarded CLI commands — packaging/gateway-msix/src/OpenClaw.Gateway.MSIXHost/Program.cs:151-155
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Change scope 37 files, +4,569 lines, 0 removed This is a new distribution, payload, and signing system rather than a narrow packaging adjustment.

Merge-risk options

Maintainer options:

  1. Keep the release path paused (recommended)
    Do not merge the distribution and official-signing path until release owners revise the MSIX policy and required coverage.
  2. Make coexistence explicit
    Use a separate command or a tested migration so existing native/npm openclaw users keep a predictable command and state path.
  3. Approve intentional replacement
    Accept the alias replacement only with documented servicing, upgrade, rollback, state-isolation, and uninstall expectations.

Technical review

Best possible solution:

First obtain explicit release and command-routing approval; if approved, use a coexistence-safe command contract, remove the unconditional exit prompt for forwarded commands, and prove install, upgrade, uninstall, and existing-install coexistence on Windows.

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

Yes. The current-head proof shows openclaw --version reaches a successful child exit and then waits for Enter, and the unconditional wait is directly visible in source.

Is this the best way to solve the issue?

No. The staging and signing implementation has useful mechanics, but its release path and global command ownership conflict with current policy and need a coexistence decision before implementation details can be accepted.

Full review comments:

  • [P1] Preserve access to the established openclaw command — packaging/gateway-msix/src/OpenClaw.Gateway.MSIXHost/Package.appxmanifest:48
    This global alias can redirect users who already installed the documented npm command into the pinned MSIX runtime and shared state directory. Use a distinct command or an explicit, tested replacement and migration contract before registering this alias.
    Confidence: 0.98
  • [P1] Skip the exit prompt for forwarded CLI commands — packaging/gateway-msix/src/OpenClaw.Gateway.MSIXHost/Program.cs:151-155
    The finally block waits for input after every interactive invocation, including openclaw --version and failed commands. That blocks ordinary CLI use and scripts after the child has already exited; limit the prompt to the no-argument bootstrap flow.
    Confidence: 0.99

Overall correctness: patch is incorrect
Overall confidence: 0.98

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 8ff0353919cf.

Labels

Label changes:

  • add proof: sufficient: Contributor real behavior proof is sufficient. Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.
  • add status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.
  • remove status: 📣 needs proof: Current PR status label is status: ⏳ waiting on author.

Label justifications:

  • P2: This is a substantial optional distribution feature with meaningful upgrade implications but no observed outage on current main.
  • merge-risk: 🚨 compatibility: The new global App Execution Alias can change which existing openclaw executable users invoke.
  • merge-risk: 🚨 session-state: The packaged runtime uses the default user OpenClaw state path and can therefore share state with an existing installation.
  • merge-risk: 🚨 availability: Explicit forwarded CLI commands currently wait for an extra Enter after the child process exits.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦞 diamond lobster and patch quality is 🦐 gold shrimp.
  • status: ⏳ waiting on author: ClawSweeper has contributor-facing work open and is waiting for author action. Sufficient (screenshot): Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.
  • proof: sufficient: Contributor real behavior proof is sufficient. Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence. Current-head screenshots in the PR body show a test-signed package installation, alias resolution, and bundled --version and --help execution; they also expose the remaining exit-prompt defect.

Evidence

What I checked:

Likely related people:

  • Scott Hanselman: Recent main history for the release policy and CI release surface identifies this contributor on the release-signing work that contains the current MSIX pause. (role: recent release-policy contributor; confidence: medium; commits: adef8fcf30d7; files: docs/RELEASING.md, .github/workflows/ci.yml)
  • MythiliMur: Raised the existing MSIX lifecycle and Gateway-update ownership questions in this PR's review discussion. (role: reviewer; confidence: medium; files: packaging/gateway-msix)

Rank-up moves

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

  • Obtain release-owner direction on whether the paused MSIX distribution and signing route should exist.
  • Preserve existing command routing or provide a tested, documented migration contract.
  • Remove the post-command input wait and add current-head terminal proof that an explicit command returns immediately.

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 (11 earlier review cycles; latest 8 shown)
  • reviewed 2026-08-24T19:00:19.898Z sha 00164f7 :: needs real behavior proof before merge. :: [P1] Verify the staged payload before executing it | [P1] Do not delete shared OpenClaw state from the MSIX reset | [P1] Preserve existing openclaw command accessibility
  • reviewed 2026-08-24T21:02:16.467Z sha af68085 :: needs real behavior proof before merge. :: [P1] Verify staged payload before executing it | [P1] Keep MSIX reset out of shared OpenClaw state | [P1] Avoid taking over the existing openclaw command
  • reviewed 2026-08-25T06:12:53.305Z sha af68085 :: found issues before merge. :: [P1] Stop only a package-owned gateway during reset | [P1] Keep MSIX reset out of shared OpenClaw state | [P1] Avoid taking over the existing openclaw command
  • reviewed 2026-08-25T07:21:05.678Z sha af68085 :: found issues before merge. :: [P1] Stop only a package-owned gateway during reset | [P1] Keep MSIX reset out of shared OpenClaw state | [P1] Avoid taking over the existing openclaw command
  • reviewed 2026-08-25T07:53:30.979Z sha fbc0716 :: needs real behavior proof before merge. :: [P1] Preserve access to the existing openclaw command
  • reviewed 2026-08-25T08:03:17.925Z sha fbc0716 :: needs real behavior proof before merge. :: [P1] Preserve the established openclaw command
  • reviewed 2026-08-25T09:34:18.366Z sha fbc0716 :: needs real behavior proof before merge. :: [P1] Preserve access to the existing openclaw command
  • reviewed 2026-08-25T17:00:31.169Z sha fbc0716 :: needs real behavior proof before merge. :: [P1] Resolve the existing openclaw command before registering this alias | [P1] Do not pause every forwarded CLI invocation

Keep OpenClaw command forwarding transparent while marking the packaged runtime as externally supervised and disabling automatic updates.

Release the installation lock before launching OpenClaw, prevent lock-handle inheritance, and add unsigned, temporary test-signing, and policy-gated official-signing workflow modes.

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

Copilot-Session: 44c67666-9bfb-4db1-bda6-becae62926cb
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Aug 24, 2026
Recommend OpenClaw's explicit classic local onboarding command without rewriting forwarded arguments.

Record the known packaged Node executable and use the Windows process-image API as a fallback so reset registration works inside the MSIX container.

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

Copilot-Session: 44c67666-9bfb-4db1-bda6-becae62926cb
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Aug 24, 2026
Forward every command-line argument unchanged to the packaged OpenClaw CLI. Keep host-specific payload paths internal and use the bootstrap menu for full verification.

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

Copilot-Session: 44c67666-9bfb-4db1-bda6-becae62926cb
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. label Aug 24, 2026
Explain why normal launches avoid full staged-payload hashing, identify the current same-user modification boundary, and record the planned move to a dedicated isolated agent session.

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

Copilot-Session: 44c67666-9bfb-4db1-bda6-becae62926cb
@xlinush

This comment has been minimized.

@xlinush

xlinush commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. merge-risk: 🚨 security-boundary 🚨 Merging this PR could weaken sandboxing, authorization, credentials, or sensitive data. labels Aug 25, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels Aug 25, 2026
Limit the bootstrapper to payload preparation and repair. Leave Gateway shutdown and shared-state removal to OpenClaw's documented uninstall flow, while preserving atomic replacement of stale prepared payloads.

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

Copilot-Session: 44c67666-9bfb-4db1-bda6-becae62926cb
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 25, 2026
@xlinush

xlinush commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@xlinush
xlinush marked this pull request as ready for review August 25, 2026 16:56
@clawsweeper

clawsweeper Bot commented Aug 25, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. label Aug 25, 2026
@xlinush

xlinush commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Aug 25, 2026
@shanselman

Copy link
Copy Markdown
Collaborator

Thank you for putting this together. This is a substantial and thoughtful first contribution. The provenance metadata, payload validation, x64/ARM64 structure, signing-policy work, tests, and documentation show a lot of care. The feedback below is intended to help us settle the Windows product and lifecycle contract, rather than to discount the implementation work already here.

Overall direction

I think a small Windows launcher is reasonable. Windows needs a real executable for an MSIX App Execution Alias, and the launcher has useful work to do before invoking the Node-based OpenClaw CLI. NativeAOT is also a reasonable implementation choice for a small, stable launcher because it gives us a self-contained native executable with no installed .NET dependency.

NativeAOT is not itself required by MSIX, though. A self-contained managed .NET executable could do the same job. The important architectural decision is the launcher and package lifecycle, not AOT specifically.

Naming and product identity

I think openclaw.exe is the right executable name if this package is intended to become the canonical native-Windows distribution of the complete OpenClaw CLI. Users should be able to type openclaw on Windows, macOS, Linux, and WSL even though each platform reaches openclaw.mjs differently.

The internal project name OpenClaw.Gateway.MSIXHost is less clear. This process does not host the Gateway or Node in-process. It verifies/prepares files and launches a child process. Something like OpenClaw.MsixLauncher or OpenClaw.WindowsLauncher would describe that responsibility more directly.

There is also a product-identity question: the package is named OpenClaw.Gateway, while explicit arguments expose the entire OpenClaw CLI. If this distributes the complete CLI, OpenClaw.CLI or OpenClaw may be the more accurate package identity. If it is intentionally Gateway-only, a distinct openclaw-gateway.exe command may be more honest.

App Execution Alias

An App Execution Alias is the native MSIX mechanism for exposing a CLI command, so the manifest approach is correct in isolation. The unresolved concern is ownership of the global openclaw command.

Today an npm installation provides openclaw.cmd and openclaw.ps1. This MSIX would add %LOCALAPPDATA%\Microsoft\WindowsApps\openclaw.exe. Which command wins can depend on the shell, PATH ordering, PATHEXT, and whether the user has disabled an alias in Windows Settings. We could end up with two package managers owning the same command while both use the same ~\.openclaw state.

Before taking the global alias, I think we need an explicit decision between these models:

  1. The MSIX replaces npm as the supported native-Windows installation. In that case, openclaw.exe and the alias are correct, but we need migration, conflict detection, upgrade, uninstall, and state-ownership behavior.
  2. The MSIX coexists with npm. In that case, a preview alias such as openclaw-msix.exe is safer until coexistence is designed and proven.
  3. The package installs only the Gateway. In that case, it should probably use an explicit Gateway command instead of claiming the general CLI name.

My preference is model 1 as the eventual user experience, but model 2 while this is still an experimental distribution path.

Keep command behavior cross-platform

Packaging can be platform-specific, but openclaw should mean the same thing everywhere:

macOS/Linux: openclaw -> node openclaw.mjs
Windows:     openclaw -> openclaw.exe -> node openclaw.mjs

The Windows launcher should be as transparent as possible. Currently, a zero-argument invocation is intercepted for package preparation instead of being forwarded to OpenClaw as it is on other platforms. That makes behavior depend on the installation channel.

I would prefer explicit setup and repair experiences, such as openclaw setup and openclaw doctor, or a separate Start menu application named OpenClaw Setup. A pure CLI package should otherwise use AppListEntry="none", as recommended by Microsoft's CLI MSIX guidance.

Reconsider extracting the application from the MSIX

The largest architectural concern is not NativeAOT. It is packaging a tar archive inside the MSIX and then copying the application into %USERPROFILE%\.openclaw-msix\app.

That gives us two copies of the application and requires custom hashing, inventory markers, locks, rollback, repair, cleanup, and update coordination. It also moves the executable code out of the immutable, tamper-protected MSIX package into a same-user-writable directory. Some of the strongest benefits of MSIX are therefore lost.

Before committing to that design, I think we should prove whether bundled node.exe and openclaw.mjs can run directly from the read-only package installation. OpenClaw configuration and mutable state can remain under the user profile, but packaged application code ideally remains package-owned and immutable.

If extraction is genuinely required because of Node/npm layout constraints, that requirement should be documented with evidence. The extracted layout should then use immutable, content-addressed version directories. New processes can select the new version without renaming or deleting the directory used by an already-running Gateway.

Merge-blocking correctness issues

I independently reviewed the current head and agree with these three blockers:

  1. .github/workflows/gateway-msix.yml:348 interpolates openclaw_ref directly into a PowerShell script. A crafted workflow-dispatch value can inject PowerShell and bypass the official-signing authorization check. Please pass the value through an environment variable and read it as data.
  2. Program.cs:151 waits for Enter after every interactive invocation. This makes ordinary commands such as openclaw --version and openclaw status appear to hang. The pause should apply only to a deliberate Explorer/Start-menu bootstrap experience, not forwarded CLI commands.
  3. PayloadStager.cs:205 renames the installed payload directory without coordinating with a running Gateway. On Windows this can fail on locked files or disrupt the live process. Versioned payload directories or explicit lifecycle coordination are needed.

Proof still needed

Before treating this as a production distribution path, I would want to see:

  • A successful current-head GitHub Actions run.
  • Real ARM64 installation and runtime proof, not only an ARM64 build matrix.
  • Windows App Certification Kit coverage.
  • Install, update, rollback, and uninstall proof while a Gateway is running.
  • Coexistence or migration proof for an existing npm installation.
  • End-to-end proof that OPENCLAW_NO_AUTO_UPDATE=1 actually prevents an upstream self-update.
  • A maintainer decision on the repository's currently paused MSIX distribution policy.

The focused host tests and signing-policy fixtures pass, which is a good foundation. They do not currently cover the three lifecycle/signing blockers above.

Suggested landing path

I would preserve this work but separate experimentation from global product ownership:

  1. Land or iterate on the packaging path using a preview-specific identity/alias and unsigned or test-signed artifacts.
  2. Resolve whether application code can run directly from the immutable package.
  3. Define npm replacement/coexistence, Gateway lifecycle, state, update, and uninstall contracts.
  4. Prove both architectures and the real installed behavior.
  5. Only then claim the global openclaw.exe alias and enable official signing/distribution.

Again, there is a lot of solid engineering here. The remaining questions are mostly about choosing a durable Windows product boundary so this launcher stays small and understandable instead of becoming a second package manager around OpenClaw.

@shanselman

Copy link
Copy Markdown
Collaborator

Important clarification on my review above: the intended model is that the Companion/Windows Node app is distributed through the Microsoft Store, while the Gateway is a separate, non-Store MSIX that the Companion optionally acquires and installs.

That context changes a few parts of the assessment:

  • The OpenClaw.Gateway package identity makes more sense as a separately installed component.
  • The Gateway MSIX does not itself need to be a Store submission, although it should still be validated as a production MSIX.
  • A global openclaw.exe App Execution Alias can be appropriate if installing the optional Gateway is also the explicit act that installs the native-Windows OpenClaw CLI.
  • The Companion, rather than the launcher, should ideally own acquisition, installation, update, repair, rollback, and uninstall of the Gateway package.

It also makes the boundary between the two packages more important. Before treating this as the release architecture, I think we need a written and tested contract for:

  1. How the Store-delivered Companion obtains and installs the independently signed Gateway MSIX, including user consent and the supported Windows deployment API or App Installer flow.
  2. Stable publisher and package identity, trusted signing, version discovery, update source, rollback, and uninstall behavior.
  3. Store certification/policy confirmation for a Store app that downloads and initiates installation of a separate non-Store executable package. I would confirm this exact scenario with Partner Center rather than assume it is accepted.
  4. Whether the Companion prevents, detects, or explains conflicts with an existing npm openclaw installation before enabling the openclaw.exe alias.
  5. Which component stops and restarts a running Gateway during package updates.
  6. Which component owns shared state under ~\.openclaw, and what remains after either package is removed.

This model strengthens the argument for making the Gateway MSIX itself simple and immutable. Ideally it contains the runnable Node/OpenClaw payload, while the Companion updates the whole signed package. Extracting another mutable application copy and implementing a second repair/update system inside openclaw.exe duplicates responsibilities that the Companion plus MSIX deployment layer could own.

So my adjusted recommendation is:

  • Keep OpenClaw.Gateway as the separate component identity.
  • Keep openclaw.exe and the App Execution Alias if the optional install is explicitly intended to provide the canonical Windows CLI.
  • Rename the internal MSIXHost project to Launcher or Bootstrapper for clarity.
  • Have the Companion own Gateway package lifecycle.
  • Keep the launcher transparent: set environment, forward arguments, launch packaged Node/OpenClaw, and return the exit code.
  • Resolve npm coexistence and Store-policy validation before enabling this as a production acquisition path.

Thank you for the architectural context. It makes the two-package direction much clearer and narrows the key design question to the contract between Companion, Gateway MSIX, and the existing cross-platform CLI.

@MythiliMur

Copy link
Copy Markdown

Thanks for the detailed review @shanselman. The worry that I have with app execution alias if that we will always have to do catchup with whatever happens in the actual openclaw gateway which I want to avoid if possible. Seems like you already made it optional in your adjusted recommendation.

Things that will be captured in next set of PRs specifically for MSIX:

  1. Where will these MSIXs be stored - CDN, github releases or something else. We have alignment that it won't be in Store as companion app will go there.
  2. MSIX update story for prosumer - will companion app take care of it? Should we add it part of existing /update command and/or provide a new generic mechanism like baked in updateprovider in gateway
  3. Companion app consuming this MSIX instead of WSL or even npm for native windows gateway install.

@MythiliMur

Copy link
Copy Markdown
  • Make sure we are not bundling any other package (e.g., node.js)
  • see if you can do winget install as part of MSIX install. Can it run a setup script of some sort?

@RomneyDa

Copy link
Copy Markdown
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 session-state 🚨 Merging this PR could lose, corrupt, stale, or mis-associate session or agent state. 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. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants