Repository navigation
Description
Summary
Native Gateway setup can sit on "WinGet finished. Waiting for the Gateway package registration." for the full 30-minute acquisition budget, even though the Store has already deployed the package. WinGet exits 0, but the Store staged the package for the machine (S-1-5-18) and never registered it for the current user. NativeGatewayPackageAcquisition.EnsureAsync can't distinguish this from a slow deployment, so it polls FindPackagesForUser until the deadline and then reports a generic timeout.
This is a different failure from #1756 ([Windows ARM64] Native Gateway setup times out while Microsoft Store deployment continues). In #1756 deployment is still running. Here deployment has finished and no registration will ever arrive.
Environment
- Windows 11 24H2 (10.0.26100), x64
- WinGet v1.29.380 (
Microsoft.DesktopAppInstaller_1.29.379.0) - Companion: Debug build from source, unpackaged. The acquisition, installer, and resolver files are identical to
mainat 7967d50 - Gateway Store product
9NV70LV3D6XC, deployed version2026.10.900.0 - History:
OpenClawFoundation.OpenClawGateway_2026.10.600.0_x64__rfcbke2p71se2was installed for this user until about 2026-11-02, then removed before this setup run
What happened
Timeline from native-setup-*.jsonl, Microsoft-Windows-Store/Operational and Microsoft-Windows-AppXDeploymentServer/Operational (local time):
- 2026-10-31 19:12 and 2026-11-02 08:48: while 2026.10.600.0 was still installed, Windows Update's background scan (
MoUpdateOrchestratorDeviceScan/MoUpdateOrchestratorUserScan) queued an update item forOpenClawFoundation.OpenClawGateway_rfcbke2p71se2. At 2026-11-02 18:35 aMoUsoCoreWorkerresume of that item logged[Error] Creating UWA Work, and the item stayed queued. - The package was then removed for the user. The queued update item was not cleared.
- 2026-11-03 22:03:39: setup runs
winget install --id 9NV70LV3D6XC --source msstore --silent .... - 22:03:42: the Store install service logs
Work already enqueued. Refusing to queue duplicate work CatalogId = PackageFamilyName:OpenClawFoundation.OpenClawGateway_rfcbke2p71se2. WinGet resumes the existing item (winget-RestartWithTelemetry) instead of creating a per-user acquisition. The item runs withIsUpdate = true,Install Starting. Client Sid: S-1-5-18, User Sid: S-1-5-18. - 22:06:50: AppX deployment reports the Stage operation for
OpenClawFoundation.OpenClawGateway_2026.10.900.0_x64__rfcbke2p71se2"finished successfully". The folder exists underC:\Program Files\WindowsApps. - 22:06:51:
Update requested from LocalSystem context. Attempting to register for all logged-on users who have it, followed byNothing to register for User: S-1-5-21-...-1000. Skipping Install. - 22:06:52: WinGet exits 0 with
Starting package install... Successfully installed. Setup logsWinGet finished. Waiting for the Gateway package registration. - From then on,
Get-AppxPackage -Name OpenClawFoundation*returns nothing for the user andwinget list --id 9NV70LV3D6XCreportsNo installed package found. Setup keeps polling until the 30-minute deadline.
A setup cancelled 0.6 s after starting and retried immediately did not contribute. The Store log shows only one winget.exe reaching the install service (22:03:40), and the conflicting queue item predates the run by more than a day.
Why Companion stays stuck
NativeGatewayPackageAcquisition.EnsureAsynctreats WinGet success as "registration will follow" and pollsresolver.ResolveAsynconce a second until the deadline (NativeGatewayPackageAcquisition.cs#L86-L100).NativeGatewayPackageResolveronly looks at current-user registrations viaPackageManager.FindPackagesForUser(string.Empty)(NativeGatewayPackageResolver.cs#L37), so a package that is staged but not registered looks the same as one that hasn't arrived yet.- The final
TimeoutExceptionsays "Windows may still finish deployment. Check WinGet and Microsoft Store access, then retry native setup." In this state Windows will never finish, and a plain retry probably hits the same queued item. Retry was not exercised on this host.
Expected
After WinGet reports success, setup either continues with a registered Gateway package or fails quickly with guidance that names this state. It should not wait the full acquisition budget for a registration that won't happen.
Proposed fix
In NativeGatewayPackageAcquisition.EnsureAsync, once installPackage returns and the first resolve after it still throws NativeGatewayPackageNotInstalledException:
- Try registering the staged Store package for the current user, once, by family name:
PackageManager.RegisterPackageByFamilyNameAsync("OpenClawFoundation.OpenClawGateway_rfcbke2p71se2", null, DeploymentOptions.None, null, null), using the expected family thatNativeGatewayPackageIdentityalready derives. The equivalent PowerShell isAdd-AppxPackage -RegisterByFamilyName -MainPackage <family>. Registering an already-staged package needs no elevation and downloads nothing. - If registration succeeds, go back to the existing
ResolveAsyncverification. The registered package must still pass the existing identity, publisher, and alias checks before setup trusts it. - If registration fails because the package isn't staged (a real slow deployment, as in [Windows ARM64] Native Gateway setup times out while Microsoft Store deployment continues #1756), keep the current polling loop and budget unchanged.
- If registration fails for any other reason, fail now with a specific message and the HRESULT in the setup log, not after 30 minutes. Point the user to the Microsoft Store listing ("Get"/"Install") or the manual
Add-AppxPackage -RegisterByFamilyNamecommand.
Keep registration behind the injected installer/resolver seam so the fake-resolver tests in tests/OpenClaw.SetupEngine.Tests/NativeGatewayPackageAcquisitionTests.cs can cover:
- WinGet succeeds, not registered, register-by-family succeeds, resolve succeeds (continues without waiting).
- WinGet succeeds, register-by-family returns "not staged", polling continues and still respects the deadline ([Windows ARM64] Native Gateway setup times out while Microsoft Store deployment continues #1756 behavior preserved).
- WinGet succeeds, register-by-family fails with another error (fails fast with the specific message).
- Cancellation during the registration attempt.
This only restores a registration that WinGet already started for this Store package. It does not touch other packages, and it does not require elevation or -AllUsers queries.
Workaround
Register the staged package for the current user, then select Retry setup:
Add-AppxPackage -RegisterByFamilyName -MainPackage OpenClawFoundation.OpenClawGateway_rfcbke2p71se2Not yet run on the reporting host. Installing from the Microsoft Store listing should work too.
Related
- [Windows ARM64] Native Gateway setup times out while Microsoft Store deployment continues #1756 ([Windows ARM64] Native Gateway setup times out while Microsoft Store deployment continues): same wait loop, but a different cause (deployment still in progress).
- [Bug]: Store uninstall leaves managed Gateways behind and reinstall does not refresh them #1712 ([Bug]: Store uninstall leaves managed Gateways behind and reinstall does not refresh them): related Gateway MSIX uninstall/reinstall lifecycle. Here the Gateway was removed but a Windows Update item for it stayed queued.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Projects
- StatusShow more project fieldsBacklog
Activity
clawsweeper commentedon Nov 4, 2026
Codex review: this still needs some work.
Summary
Keep open: current main still waits until the acquisition deadline when WinGet succeeds without current-user registration, and the collaborator-authored report establishes a distinct setup failure.
Reproducibility: Current source proves that successful installation followed by persistent missing registration consumes the remaining deadline; the report supplies a concrete Windows timeline, but no native reproduction or tests were run during this read-only review.
Next step
Establish a failing staged-without-registration regression, then add bounded registration repair and inline recovery while preserving slow-deployment polling.
Review details
Best possible solution:
Automatically repair current-user registration for the staged Store Gateway, with an inline Fix action or actionable failure when repair cannot complete.
Do we have a high-confidence way to reproduce the issue?
Current source proves that successful installation followed by persistent missing registration consumes the remaining deadline; the report supplies a concrete Windows timeline, but no native reproduction or tests were run during this read-only review.
Is this the best way to solve the issue?
A single injected registration-recovery attempt fits the existing acquisition owner, provided native evidence establishes which errors mean staging is still pending and all existing resolver checks remain mandatory.
AGENTS.md: found and applied where relevant.
Remaining risk / open question:
Codex review notes: model internal, reasoning medium; reviewed against 7967d509886f.
Label changes
Label changes:
P0: The reported native onboarding state cannot produce a usable Gateway through existing setup controls and requires external package-registration recovery.impact:ux-release-blocker: A community user encounters a long wait followed by generic retry guidance, with no in-product registration repair.issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.clawsweeper:source-repro: Current issue advisory state selects this label.clawsweeper:queueable-fix: Current issue advisory state selects this label.clawsweeper:fix-shape-clear: Current issue advisory state selects this label.Label justifications:
P0: The reported native onboarding state cannot produce a usable Gateway through existing setup controls and requires external package-registration recovery.impact:ux-release-blocker: A community user encounters a long wait followed by generic retry guidance, with no in-product registration repair.Evidence reviewed
Acceptance criteria:
What I checked:
src/OpenClaw.SetupEngine/NativeGatewayPackageAcquisition.cs:86, 7967d509886f)src/OpenClaw.SetupEngine.UI/NativeGatewayPackageResolver.cs:37, 7967d509886f)tests/OpenClaw.SetupEngine.Tests/NativeGatewayPackageAcquisitionTests.cs:228, 7967d509886f)src/OpenClaw.SetupEngine.UI/Pages/NativeGatewaySetupPage.xaml.cs:448, 7967d509886f)src/OpenClaw.SetupEngine/NativeGatewayPackageAcquisition.cs:19, 64357496432f)How this review workflow works
@clawsweeper re-reviewcomments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.@clawsweeper re-reviewor@clawsweeper re-runon an open PR or issue to request a fresh review only.@clawsweeper reviewto request a fresh review only.@clawsweeper explainto ask for more context, or@clawsweeper stopto stop active automation.Reviewed November 4, 2026, 1:42 AM ET / 06:42 UTC.
larroy commentedon Nov 4, 2026
larroy commentedon Nov 4, 2026
related #1969
fix(setup): register a staged Store Gateway instead of waiting 30 min…