Skip to content

fix(setup): give native Gateway Store install a 30-minute budget with elapsed-minute wait status - #1750

Merged
shanselman merged 4 commits into
openclaw:mainfrom
larroy:am/timeout
Oct 30, 2026
Merged

shanselman merged 4 commits into
openclaw:mainfrom
larroy:am/timeout

Conversation

@larroy

@larroy larroy commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Related: #1756

What Problem This Solves

Fixes: native onboarding marks "Install or verify Gateway package" as needing attention, and requires a retry, while a cold Microsoft Store deployment is still running past 5 minutes.

User Impact

User impact: a first-time native Gateway install from Microsoft Store now gets 30 minutes before setup gives up, and the package step shows "Still installing the Gateway from Microsoft Store... (N min elapsed)" once per minute instead of one static message. Operators can change the bound with OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT (seconds).

Why This Change Was Made

The observed #1756 timeline (WinGet started Store at 15:46:59, AppX registered at 15:53:55, Store completed at 16:02:47) outlives the previous 5-minute deadline. One budget now has one owner:

  • NativeGatewayPackageAcquisition.DefaultTimeout (30 minutes) bounds EnsureAsync and both NativeGatewayMsixInstaller command timeouts (WinGet install and WinGet repair). It replaces the private NativeGatewayMsixInstaller.CommandTimeout.
  • OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT overrides it in seconds (1-2147483). Any other value logs a warning and keeps the default. An explicit EnsureAsync timeout argument still wins.
  • Cancellation is unchanged: it reaches CommandRunner and stops the WinGet process tree; Windows may still finish a submitted deployment.
  • NativeGatewaySetupPage.InstallAsync updates a localized waiting status every minute (all six locales, with a minute unit). It formats through SetupLocalization.Format, so a malformed translation falls back to the template instead of failing the install. No WinGet stdout parsing, no second installer launch, no background resume.
  • ARCHITECTURE.md and SETUP_ENGINE_REDESIGN.md describe the default, the override and precedence.

Preserved invariant: install at most once per attempt, cancellation kills WinGet, registration polling starts only after the installer returns. PR openclaw/openclaw#1741 (the 5s -> 30s pre-pairing HTTP probe) is intentionally left alone.

Review fixes since the first revision
  • ClawSweeper P2: NativeGatewayPackageAcquisitionTests joined the non-parallel EnvironmentVariableCollection, so installer tests cannot observe a temporary override.
  • ClawSweeper P3: every waiting translation includes a minute unit; updates are once per minute with rounded minutes, so no "0 min" message appears. NativeGatewaySetupUxContractTests checks the unit per locale.
  • ClawSweeper low-value test: removed EnsureAsync_UnsetEnvironment_Uses30MinuteDeadline (it also passed with the old 5-minute bound).
  • Stray /data> text node removed from all six .resw files.
  • Rubber-duck review (all P3): waiting status uses SetupLocalization.Format; the EnsureAsync XML doc is back on EnsureAsync; the invalid-override warning derives its minutes from DefaultTimeout; EnsureAsync_ExplicitTimeoutStillWinsOverEnvironment is bounded to 10 s so an environment-wins regression fails instead of passing after 300 s; the override test is renamed to Timeout_EnvironmentOverride_IsUsedOnlyForValidValues because it does not assert the warning.

Evidence

Automated, on head b22a3cc7:

  • EnsureAsync_ExplicitTimeoutStillWinsOverEnvironment: explicit 50 ms timeout with the variable set to 300 throws the acquisition TimeoutException with retry guidance. Mutation check: forcing ResolveTimeout() to win makes it fail in 10 s.
  • Timeout_EnvironmentOverride_IsUsedOnlyForValidValues: 90 is used; 0, not-a-number and 2147484 keep the 30-minute default.
  • Installer tests observe DefaultTimeout at the install, repair and retry command sites.
  • NativeGatewaySetupUxContractTests: every .resw waiting string contains Microsoft Store, {0} and its locale's minute unit.

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

Required proof pools

  • windows-winui-interactive: the native onboarding package-step status text and its localized strings changed.

Validation

Local, Windows ARM64, head b22a3cc7:

  • ./build.ps1: all builds succeeded (Shared, Cli, WinNodeCli, SetupEngine, WinUI); documentation validation passed.
  • dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore: 4808 passed, 24 skipped, 0 failed.
  • dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore: 4754 passed, 0 failed.
  • dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --no-restore: 2490 passed, 1 skipped, 0 failed.
  • Shared and SetupEngine ran with OPENCLAW_REPO_ROOT set to the worktree. Without it, 5 MXC test-host and 3 artwork source-contract tests fail on path discovery; none touch this change.

CI on the previous head b410e096: every executed job passed except "UI, functional, and accessibility tests", where the test host crashed during Windows App SDK bootstrap in VoiceServiceProgressRoutingTests / WorkspaceSessionLayoutTests (not touched here). New CI for b22a3cc7 is pending.

Real Behavior Proof

  • Environment tested: local Windows ARM64 dev machine with the Gateway package already installed.
  • PR head or commit tested: b22a3cc7.
  • Exact steps or command run: the test commands above.
  • Evidence after fix: automated deadline, precedence, installer-timeout and locale contract results above.
  • Observed result: all passed; the precedence mutation fails as expected.
  • Screenshot or artifact links verified? N/A
  • Not verified or blocked:
    • Live cold Microsoft Store install on a machine without the Gateway package (about 16+ minutes); not available in this environment.
    • windows-winui-interactive screenshot of the waiting status: the first update needs a minute of real WinGet runtime. Feasible next step: on a machine without the package, set OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT=150, run native setup, capture "1 min" / "2 min" updates, then confirm the timeout, Retry, and no remaining winget.exe.

Security Impact

  • New permissions or capabilities? No
  • Secrets or tokens handling changed? No
  • New or changed network calls? No
  • Command or tool execution surface changed? No
  • Data access scope changed? No
  • If any answer is Yes, explain the risk and mitigation:

Compatibility and Migration

  • Backward compatible? Yes
  • Config or environment changes? Yes: optional OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT (seconds); unset keeps the new 30-minute default.
  • Migration needed? No
  • If yes, list the exact upgrade steps:

Review Conversations

  • I replied to or resolved every bot review conversation addressed by this PR.
  • I left unresolved only conversations that still need maintainer judgment.

@clawsweeper

clawsweeper Bot commented Oct 16, 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 clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. 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: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 16, 2026
@clawsweeper

clawsweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge.

What this changes

Extends native Gateway acquisition to 30 minutes, adds an environment override, and displays localized elapsed-minute installation status.

Example: Microsoft Store installation runs from 15:46:59 until 16:02:47.

  • Before: Setup expires after five minutes and requires Retry while Store deployment continues.
  • After: Setup allows up to 30 minutes and updates elapsed-minute status while WinGet runs.

Review scores

Measure Result What it means
Overall readiness 🧂 unranked krab (1/6) The focused patch appears correct and resolves prior findings, but supplied evidence does not exercise the changed shipped workflow required by scoped policy.
Proof confidence 🧂 unranked krab (1/6) Real behavior proof is not required for maintainer- or bot-authored pull requests.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Native onboarding reports failure while Microsoft Store deployment is still running and makes the user retry.
Reason: The observed deployment exceeds the current deadline, and maintainer direction supports a longer bounded wait with visible progress; maintainer authorship also establishes direction for the environment override.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a confirmed timeout still present on main; both earlier findings are fixed, and no new actionable code defect was found.

Priority: P2
Reviewed head: b22a3cc716d87af086f4775225a350e07ac97d8d

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: Supplied tests do not demonstrate a shipped cold-Store install exceeding five minutes, visible minute updates, automatic continuation, or retained behavior after upgrading from the latest stable release.
Agent review details

How this fits together

The native setup page delegates Store acquisition to the existing acquisition and installer owners, then proceeds only after current-user package registration and execution aliases are verified.

flowchart TD
  A[Native setup page] --> B[Package acquisition deadline]
  B --> C[WinGet installer]
  C --> D[Microsoft Store deployment]
  C --> E[Package registration verification]
  E --> F[Gateway setup continuation]
  A --> G[Localized elapsed-minute status]
Loading

Technical review

Best possible solution:

Retain one bounded acquisition owner, visible waiting feedback, verified registration before continuation, and actionable in-product Retry and cancellation.

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

Current-main acquisition and installer limits reproduce the reported failure path whenever Store deployment exceeds five minutes; the linked ARM64 report supplies a concrete affected version and deployment timeline, but this review ran no target code.

Is this the best way to solve the issue?

The smallest complete fix fits the existing acquisition, installer, and page owners, preserves the single-attempt and cancellation invariants, and avoids parsing WinGet output or introducing a second installation path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 4cbbe51c45a7.

Provenance checked

  • Acquisition deadline changes intended behavior with a stated reason (dba8121: Guided native onboarding used a bounded registration wait; the later WinGet integration retained that deadline while awaiting installer cleanup.)
  • WinGet installation and repair timeout changes intended behavior with a stated reason (85f6624: The repair change preserved existing timeout and cancellation behavior; this PR explains why the observed cold deployment needs a longer shared bound.)

Testing

Proof path: unit tests only.

Security

None.

Evidence

What I checked:

Likely related people:

  • Karen: Raw commit dba8121 adds src/OpenClaw.SetupEngine/NativeGatewayPackageAcquisition.cs:51 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/NativeGatewayPackageAcquisition.cs)
  • Linus Huang: Raw commit 6bcc68c adds src/OpenClaw.SetupEngine/NativeGatewayPackageAcquisition.cs:44 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 6bcc68cde97c; files: src/OpenClaw.SetupEngine/NativeGatewayPackageAcquisition.cs)
  • Dallin Romney: Raw commit 85f6624 adds src/OpenClaw.SetupEngine/NativeGatewayMsixInstaller.cs:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 85f66247850e; files: src/OpenClaw.SetupEngine/NativeGatewayMsixInstaller.cs)
  • Pedro Larroy: Raw commit e5122db adds src/OpenClaw.SetupEngine.UI/Pages/NativeGatewaySetupPage.xaml.cs:171 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: e5122db3c943; files: src/OpenClaw.SetupEngine.UI/Pages/NativeGatewaySetupPage.xaml.cs)

Labels

Label changes:

  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: Slow Store deployment interrupts native onboarding, but the existing wizard provides an in-product Retry path.
  • rating: 🧂 unranked krab: Overall readiness is 🧂 unranked krab; proof is 🧂 unranked krab and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rank-up moves

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

  • Supply current-head runtime evidence for the cold Store installation and visible waiting behavior identified in the proof assessment.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (1 earlier review cycle)
  • reviewed 2026-10-16T20:12:31.338Z sha 1438a00 :: needs changes before merge. :: [P2] Serialize tests that change the acquisition timeout environment | [P3] Include the elapsed time unit in every waiting translation

Reviewed October 30, 2026, 2:20 AM ET / 06:20 UTC (Revision 2).

A cold Microsoft Store deployment can outlive the previous 5-minute
acquisition deadline, so Companion marked package acquisition as needing
attention while WinGet was still running and required a retry. Raise the
shared deadline to 30 minutes via
NativeGatewayPackageAcquisition.DefaultTimeout, shared by EnsureAsync and
the WinGet/WinGet-repair command timeouts. Override it with
OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT (seconds, 1-2147483); an
explicit EnsureAsync timeout argument still wins and invalid values warn
and keep the default. Cancellation still reaches CommandRunner and stops
the WinGet process tree.

While the install runs, NativeGatewaySetupPage now shows localized
waiting progress (elapsed minutes) after the first 30 seconds in all six
locales, and ARCHITECTURE.md/SETUP_ENGINE_REDESIGN.md document the new
bound.

Validation: build.ps1 all green; SetupEngine 2340 passed, Tray 4083
passed, Shared 4313 passed.
…timeout tests

Address review on openclaw#1750: put the acquisition-timeout tests in the
nonparallel EnvironmentVariableCollection so installer tests cannot
observe a temporary override, add a localized minute unit to the waiting
status (updated once per minute after the first minute instead of every
30 seconds, so no 0-minute message appears), remove the stray /data>
text node from all six resw files, drop the deadline test that also
passed with the old 5-minute bound, and pin both with contract tests.
@larroy larroy changed the title fix(setup): give native Gateway Store install a 30-minute budget fix(setup): give native Gateway Store install a 30-minute budget with elapsed-minute wait status Oct 29, 2026
Rubber-duck review on openclaw#1750: format the waiting status through SetupLocalization.Format so a malformed translation cannot fault the pump and fail a successful install; restore the EnsureAsync XML doc that the ResolveTimeout doc displaced; derive the invalid-override warning's minutes from DefaultTimeout; bound the explicit-timeout precedence test so an environment-wins regression fails in 10 s instead of passing after 300 s; rename the override test to what it asserts.
@larroy

larroy commented Oct 30, 2026

Copy link
Copy Markdown
Collaborator Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 30, 2026
@karkarl

karkarl commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Hanselman re-review

Verdict: no new defect or blocking production issue found in Pedro's latest update. Two non-blocking findings from the earlier review remain.

Reviewed head: b22a3cc716d87af086f4775225a350e07ac97d8d.
PR merge base: 1912df7e2f976314d82baa88a5decf31218b33a1.
Previous reviewed head: b410e096faab101a021534776f076531081e7d3c.

This was a delta review of the three changed files, their affected callers and tests, and the earlier unresolved/disputed findings. It was not a second full-PR review.

Independent reviewers: claude-opus-5.5 (default context tier) and gpt-6-astra (long_context requested), both requested with high reasoning. The task tool confirmed the model identities; effective reasoning/context settings are not independently exposed. Both completed on the exact head above.

Both models agree: HIGH consensus

Consensus measures agreement that an issue exists, not agreement on its severity.

Issue Opus 5.5 GPT-6 Astra Fix confidence
Installer tests assume the default timeout without isolating an inherited OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT (NativeGatewayMsixInstallerTests.cs:22,39). LOW / P3 MEDIUM / P2 99%
The current onboarding guide still says package installation and verification share a five-minute deadline (docs/ONBOARDING_WIZARD.md:260). LOW / P3 LOW / P3 99%

Only one model flagged: LOW consensus

None in this review round.

The test issue was reproduced on this exact remote head:

$env:OPENCLAW_REPO_ROOT = (Get-Location).Path
$env:OPENCLAW_SETUP_PACKAGE_ACQUISITION_TIMEOUT = '90'
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --filter 'FullyQualifiedName~Install_UsesCurrentUserWinGetAndAllowsUpgradeExactlyOnce|FullyQualifiedName~PinnedCertificateMismatch_RepairsLatestWinGetAndRetriesOnce' --logger 'console;verbosity=normal'

Result: 3 failed, 0 passed. Every failure reports expected 00:30:00, actual 00:01:30. Production correctly honors the override; the test fixtures are not isolated.

The small fix is to serialize environment-mutating installer tests, clear and restore the override around default assertions, retain independent default expectations, and cover override propagation through install/repair/retry. The guide should document the 30-minute default and seconds-based override.

Resolved and rejected findings

  • The misplaced EnsureAsync XML documentation is fixed in the author update.
  • SetupLocalization.Format preserves current-culture formatting and guards malformed translations.
  • The explicit-timeout test now has a ten-second watchdog and still distinguishes acquisition timeout guidance from the watchdog exception.
  • No new evidence supports a stale progress write or a separate repair budget. The shared acquisition deadline and awaited cleanup remain intact.
  • The responsibilities document explicitly records historical evidence. Its historical deadline is not a current-contract defect and should not be rewritten.

Proof boundary

The exact-head CI Gate, setup/connect E2E, tray/setup/integration lane, and UI/functional/accessibility lane were successful when checked. These do not replace visible proof of the changed elapsed-minute state or a real cold Microsoft Store installation lasting more than five minutes. Those behavior proofs remain unverified.

The fixes and fresh validation results follow.

Appended maintainer fixes

Pushed dd1a78558654138e985ff389fb2561330c7ac867 on top of the reviewed author head, without rewriting the contributor's commits.

  • Installer tests now use the existing nonparallel environment collection and EnvironmentScope to restore inherited values even on assertion failure.
  • Default assertions independently require 30 minutes. The repair/retry theory also covers a 90-second override at all three command calls.
  • The current onboarding guide documents the 30-minute default, the valid seconds override and retained cancellation warning. The historical snapshot remains unchanged.
  • No production source changed in this repair commit. Pedro's formatting, documentation and watchdog fixes remain intact.

Validation ran on the source tree committed above:

Command Result
.\build.ps1 Passed, native ARM64; all five projects built.
dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore --verbosity quiet 4,808 passed, 24 skipped, 0 failed.
dotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restore --verbosity quiet 4,754 passed, 0 skipped, 0 failed.
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --filter 'FullyQualifiedName~NativeGatewayMsixInstallerTests|FullyQualifiedName~NativeGatewayPackageAcquisitionTests' --verbosity quiet with the inherited timeout override set to 90 41 passed, 0 skipped, 0 failed. The three original failures now pass, and the added override case passes.
dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore --logger 'console;verbosity=normal' 2,476 passed, 1 skipped, 15 failed in the existing GatewayPackageCleanupTests.Worker_* cases. Windows PowerShell refuses their temporary scripts because running scripts is disabled on this host.
.\scripts\validate-docs.ps1 Passed: 68 Markdown files.
.\scripts\validate-agent-skills.ps1 Passed: 15 skills and 24 Markdown files.
.\scripts\test-agent-skills-validator.ps1 Passed: 27 fixtures plus repository skills.
git diff --check Passed.

The 15 cleanup-worker failures match the earlier host execution-policy blocker. No execution policy was weakened or changed, and no unrelated test was disabled. The full SetupEngine suite is not clean on this host.

Both verified review findings are fixed. The dual-model verdict above applies to b22a3cc7; this section records the subsequent repair and its validation, not a second dual-model review of the repair commit. Current-head visible waiting-state proof and a real slow Store deployment remain unverified. Hosted checks on the previous head are not claimed as checks on the appended commit.

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

Labels

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: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants