Repository navigation
fix(setup): native Gateway setup waits 30 minutes when the Store stages the package without registering it - #2000
Conversation
…utes When WinGet succeeds but the Store staged the Gateway package without registering it for the current user, native setup polled until the 30-minute acquisition deadline (openclaw#1999). After the first post-install resolve misses, EnsureAsync now registers the staged Store family once for the current user via RegisterPackageByFamilyNameAsync. A registered package still passes the resolver's identity, health and alias checks. "Not staged" (extended error 0x80070490 or 0x80073CF1) keeps the existing bounded wait for slow deployments (openclaw#1756); other errors fail fast with HRESULTs, a deployment activity ID and localized recovery guidance. The post-install timeout message no longer claims Windows may still finish. Fixes openclaw#1999
|
🦞👀 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: needs maintainer review before merge. What this changesThis PR attempts current-user registration of the staged Store Gateway after WinGet succeeds, preserving package validation and bounded waiting for unfinished deployments. Example: WinGet exits successfully, but OpenClawFoundation.OpenClawGateway_rfcbke2p71se2 is staged without a current-user registration.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this collaborator-authored PR addresses a concrete current-main setup failure, and no definite introduced defect was found; it remains a draft with an unresolved failing CI job. Priority: P0 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe native setup page calls package acquisition, which coordinates WinGet, Windows package registration and trusted package resolution before Gateway profile preparation. flowchart TD
A[Native setup page] --> B[Package acquisition]
B --> C[WinGet Store installation]
B --> D[Current user package resolver]
B --> E[Staged package registrar]
E --> F[Windows deployment API]
D --> G[Verified Gateway setup]
Technical reviewBest possible solution: Recover the staged Store package within the existing acquisition owner while preserving current-user scope, trusted resolution, slow-deployment waiting and actionable recovery. Do we have a high-confidence way to reproduce the issue? Current-main source deterministically consumes the acquisition deadline when WinGet succeeds but current-user registration remains absent, matching the linked report's Windows deployment timeline; this read-only review ran no target code. Is this the best way to solve the issue? A single injected registration attempt is a focused repair using the existing acquisition and verification owners, with separate Windows and portable components justified by their platform boundaries. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7967d509886f. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
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 Reviewed November 4, 2026, 4:14 AM ET / 09:14 UTC. |
Closes #1999
Related: #1756
What Problem This Solves
Fixes: native Gateway setup waits the full 30 minutes, then reports a misleading timeout, when the Microsoft Store puts the Gateway package on the machine but never registers it for the current user.
User Impact
User impact: when WinGet finishes but the Gateway package is on the machine without being registered for this user, setup now registers it and continues within seconds. If Windows refuses, setup fails right away with guidance that names the Microsoft Store and the exact
Add-AppxPackage -RegisterByFamilyNamecommand. Slow Store deployments (#1756) keep the existing 30-minute wait.Why This Change Was Made
After WinGet succeeds and the first check still finds no package for this user, setup registers
OpenClawFoundation.OpenClawGateway_rfcbke2p71se2for the current user once, usingPackageManager.RegisterPackageByFamilyNameAsync. This needs no elevation, does not use-AllUsers, and never applies to development or patched packages. A registered package still has to pass the existing identity, publisher, health and alias checks.On this host, Windows reports a package that isn't on the machine as generic
0x80073CF9with extended error0x80070490. That case, plus0x80073CF1, means "nothing on the machine": setup keeps polling within the existing deadline, so a slow deployment is never cut short. If registration fails with any other error, setup checks once more in case Windows registered the package at the same moment, then fails fast. When the timeout happens after WinGet has finished, the message no longer claims Windows may still finish.Ownership is unchanged. Setup already records this package as one it acquired, so uninstall removes only this user's registration.
Owners touched
NativeGatewayStagedPackageRegistrar(OpenClaw.SetupEngine.UI): the Windows API call. Error classification lives inNativeGatewayPackageRegistration(OpenClaw.SetupEngine, net10.0). New ledger row indocs/ARCHITECTURE.md.NativeGatewayPackageAcquisition.EnsureAsynctakes a requiredregisterStagedPackagedelegate.NativeGatewayPackageIdentity.StoreFamilyNameis a new constant. A test recomputes its publisher ID fromStorePublisher.NativeGatewaySetupPagelogs each outcome and shows the new localizedOnboarding_Native_RegistrationGuidance(all six locales).NativeGatewaySetupDiagnosticsadds the deployment activity ID, for use withGet-AppPackageLog.Evidence
NativeGatewayPackageAcquisitionTestscover:OpenClaw.Tray.UITests) registers a family that doesn't exist. It returnsNotStaged, which proves the extended error code reaches C# through CsWinRT.IsRegistered=True.Change Type
Scope
winnodeRequired proof pools
windows-winui-interactive: visible native setup progress, the registration log lines, and the recovery guidance in the isolated app.Validation
Run from the worktree with
OPENCLAW_REPO_ROOTset to it, on commit464174f7:./build.ps1: all builds succeeded (Cli, Shared, WinUI, SetupEngine, WinNodeCli).dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 4831 passed, 0 failed, 24 skipped.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 4875 passed, 0 failed.dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj: 2547 passed, 0 failed, 4 skipped (the new acquisition tests were confirmed in the run listing).dotnet test ./tests/OpenClaw.Connection.Tests/OpenClaw.Connection.Tests.csproj --filter FullyQualifiedName~NativeGatewayPackageIdentityTests: 36 passed.dotnet test tests/OpenClaw.Tray.UITests -c Debug -r win-x64 --no-build --filter FullyQualifiedName~NativeGatewayStagedPackageRegistrarTests: 1 passed.An earlier run with
OPENCLAW_REPO_ROOTaccidentally empty showed unrelated failures: 118 in Shared (MXC) and 5 in Tray (PinnedPages). The rerun with the variable set passed cleanly.Real Behavior Proof
464174f7NativeGatewayStagedPackageRegistrarTestsUI test above (realPackageManager). Separately, manual Windows PowerShell 5.1 WinRT probes ofRegisterPackageByFamilyNameAsync, andGet-AppPackageLog -ActivityID.NotStagedthrough the production registrar. The probe showedIAsyncInfo.ErrorCode=0x80073CF9,ExtendedErrorCode=0x80070490, and AppX event 404 with error0x80070490.packageManagementcapability.Security Impact
Yes, explain the risk and mitigation: setup now calls the Windows package deployment API to register one fixed, publisher-bound Store family for the current user only. There is no download, no elevation and no-AllUsers. The call happens only after the user has approved the native install. The registered package must still pass the existing trust and alias checks before setup uses it.Compatibility and Migration
Review Conversations