Skip to content

fix(setup): gate Local AI on WSL readiness - #1203

Merged
shanselman merged 5 commits into
mainfrom
karkarl-gate-local-ai-on-wsl
Aug 28, 2026
Merged

shanselman merged 5 commits into
mainfrom
karkarl-gate-local-ai-on-wsl

Conversation

@karkarl

@karkarl karkarl commented Aug 21, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • merge current main at 4c078f9ee5f9308744b2180a41bad361ceb0371d, which includes prerequisite PR fix(setup): recover uninitialized WSL automatically #1202
  • preserve fix(setup): recover uninitialized WSL automatically #1202's known-state, one-shot elevated recovery for missing or uninitialized WSL
  • keep the read-only WSL readiness gate before Capabilities can present Local AI choices
  • keep WslViabilityInspector as the single classifier and WslViabilityProbe as the single UI cache and refresh owner
  • keep WSL platform failures out of Local AI hardware and networking availability aggregation

Adapted from the ordering intent in joelagnel#4 for the post-#1178 setup architecture.

Validation

Current head: 63de5640b74f1247f799352474f31b745187dacc

  • .\build.ps1 passed. Shared, CLI, WinNode CLI, SetupEngine, and WinUI built successfully. 46 Markdown files validated.
  • dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restore passed: 3,819 passed, 32 skipped, 0 failed.
  • dotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restore passed: 1,025 passed, 0 failed.
  • focused combined fix(setup): recover uninitialized WSL automatically #1202/fix(setup): gate Local AI on WSL readiness #1203 SetupEngine matrix passed: 32 passed, 0 failed. Coverage includes disabled virtualization, missing WSL, optional-component and uninitialized WSL, ready WSL, one-shot install and reinspection, cancellation, reboot guidance, probe refresh and concurrency, existing-config classification, pipeline ordering, Local AI availability aggregation, and installed-runtime behavior in the full SetupEngine suite.
  • focused Tray setup and UI contracts passed: 6 passed, 0 failed. Coverage includes readiness before Local AI decisions, fresh retry inspection, existing-config ordering, progress ordering, and Capabilities ownership.
  • hosted CI passed on the current head. The first network-recovery attempt timed out before either test body while runner netsh.exe captured dynamic TCP port ranges. The isolated job rerun passed.
  • git diff --check passed.

Full local Tray validation is blocked by a known host testhost hang. The exact full Tray command was stopped after 24 minutes without a test result. Focused changed-path Tray tests pass, and hosted CI passed the full test job.

Real behavior proof

Current-head computer-use proof on Windows x64 used an isolated Debug build:

  • ready WSL showed Local AI available with an NVIDIA GeForce RTX 4080 SUPER, then the local setup path showed Install a new WSL gateway? and reached Set up the WSL gateway Capabilities only after the readiness and existing-state checks
  • Connect to an existing gateway routed directly to the Companion Settings handoff, which states Nothing gets installed, without entering local WSL setup
  • the existing setup path reported that no existing configuration would be affected before navigation

Automated current-tree proof covers states that are unsafe to force on the validation host:

  • PreflightWsl_FailsTerminalWhenVirtualizationDisabledInFirmware and PreflightWsl_VirtualizationFailureBlocksWhenLocalAiIsDisabled prove disabled virtualization blocks both Local AI and non-Local-AI local setup with actionable platform guidance
  • PreflightWsl_UninitializedPlatformIsInstallable, EnsureWslPlatform_InitializesPlatformAndReinspectsReadiness, and EnsureWslPlatform_RequiresRestartWhenInitializationIsStillPending prove optional-component recovery and reboot guidance
  • EnsureWslPlatform_PropagatesElevationCancellationWithoutReinspection and EnsureWslPlatform_ElevationCancellationIsNotRetriedByPipeline prove cancellation remains one-shot
  • EnsureWslPlatform_LeavesReadyWslUnchanged proves ready WSL does not invoke the installer
  • WslViabilityProbe_RefreshesCompletedInspectionWithoutRecreatingOwner and WslViabilityProbe_RefreshSharesInFlightInspectionThenStartsOneNewInspection prove deterministic refresh and in-flight sharing
  • ExistingConfigDetector_TreatsUninitializedWslAsNoDistro and focused Welcome contracts preserve existing gateway paths and prevent duplicate WSL ownership
  • pipeline ordering tests prove WSL verification finishes before Local AI runtime or model downloads

Live disabled-virtualization and optional-component mutation proof is not verified. Changing firmware virtualization or Windows optional components is unsafe on this validation host and can require a reboot.

Reviews

Rubber-duck review found no blocking or non-blocking issues.

Structured autoreview reported one proposed finding that the blocking dialog omitted remediation. Rejected after source verification: WslViabilityResult.Description already concatenates Summary and Remediation, and the dialog displays Description. No actionable autoreview finding remains.

@clawsweeper

clawsweeper Bot commented Aug 21, 2026

Copy link
Copy Markdown

🦞👀
ClawSweeper picked this up.

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

@karkarl karkarl added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 21, 2026
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. 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. labels Aug 22, 2026
@clawsweeper

clawsweeper Bot commented Aug 22, 2026 •

Copy link
Copy Markdown

Codex review: needs real behavior proof before merge. Reviewed August 28, 2026, 5:11 AM ET / 09:11 UTC.

ClawSweeper review

What this changes

The PR checks WSL readiness before local gateway capability choices, offers a fresh retry for blocked environments, and keeps Local AI availability messages limited to Local AI-specific failures.

Merge readiness

⚠️ Ready for maintainer review - 3 items remain

Keep open for normal maintainer review. Current main does not contain this distinct onboarding gate, the introduced implementation preserves the merged recoverable-WSL path, and collaborator-authored items are not eligible for automated closure.

Priority: P2
Reviewed head: 63de5640b74f1247f799352474f31b745187dacc

Review scores

Measure Result What it means
Overall readiness 🦞 diamond lobster (5/6) PR readiness rating was derived from proof quality, review findings, security review, and reviewer confidence.
Proof confidence 🌊 off-meta tidepool Not applicable: The author is a collaborator, so external-contributor proof gating does not apply; the PR body nevertheless records current-head Windows computer-use observations and focused coverage for unsafe-to-force WSL states.
Patch quality 🦞 diamond lobster (5/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The author is a collaborator, so external-contributor proof gating does not apply; the PR body nevertheless records current-head Windows computer-use observations and focused coverage for unsafe-to-force WSL states.
Evidence reviewed 5 items Introduced readiness gate: The Welcome flow refreshes WSL inspection before existing-configuration detection or navigation, and presents a retryable dialog only for blocking results.
Recovery compatibility: Only UpdateRequired, EnvironmentBlocked, and InspectionFailed block setup; Installable continues to the pipeline, where the merged recovery step installs and re-inspects WSL.
Current-main necessity check: The current-main delta after the PR base contains only chat metadata source and tests, so main has not independently absorbed any of this PR's touched setup paths.
Findings None None.
Security None None.

Live Verification

Command: dotnet test ./tests/OpenClaw.SetupEngine.Tests/OpenClaw.SetupEngine.Tests.csproj --filter "FullyQualifiedName~WslViabilityProbe|FullyQualifiedName~PreflightWsl_VirtualizationFailureBlocksWhenLocalAiIsDisabled"

Result: FAIL (failed) — execution before step 1 expect_output: sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz | [ERR_PNPM_NO_LOCKFILE] Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

sh -lc pnpm install --ignore-scripts --frozen-lockfile failed: ! Corepack is about to download https://registry.npmjs.org/pnpm/-/pnpm-11.24.0.tgz | [ERR_PNPM_NO_LOCKFILE] Cannot install with "frozen-lockfile" because pnpm-lock.yaml is absent Note that in CI environments this setting is true by default. If you still need to run install in such cases, use "pnpm install --no-frozen-lockfile"

Assertions:

  • FAIL expect_output: Passed!

How this fits together

The onboarding Welcome page starts local gateway setup and now inspects WSL before users reach capability and Local AI choices. Ready or installable WSL continues into the setup pipeline, while non-recoverable states remain at a retryable readiness dialog.

flowchart LR
A[User selects local setup] --> B[Welcome page]
B --> C[WSL readiness inspection]
C -->|Ready or installable| D[Capabilities and Local AI choices]
C -->|Blocked| E[Retryable readiness dialog]
D --> F[Setup pipeline]
F --> G[WSL platform recovery or gateway provisioning]
Loading

Before merge

  • Add real behavior proof - Not applicable: The author is a collaborator, so external-contributor proof gating does not apply; the PR body nevertheless records current-head Windows computer-use observations and focused coverage for unsafe-to-force WSL states.
  • Resolve merge risk (P2) - A false blocking WSL classification now stops local setup before the pipeline can run; the implementation mitigates this by leaving Installable non-blocking and retaining retry for the three blocking classifications.
  • Complete next step (P2) - No repair lane is needed because review found no discrete introduced defect; this collaborator PR should proceed through normal maintainer merge review.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Code and coverage production +70/-46, tests +178/-19, docs +2/-2 Regression coverage materially exceeds the focused implementation change across setup policy and WinUI ordering.

Merge-risk options

Maintainer options:

  1. Land with the guarded classification boundary (recommended)
    Accept the bounded availability risk because installable WSL remains recoverable downstream and focused regression coverage protects the early gate.

Technical review

Best possible solution:

Keep one WSL classifier, route installable states to the existing recovery pipeline, and retain the early retryable gate only for states that cannot safely proceed.

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

Yes. The source gives a deterministic local-setup path, and focused tests cover both the blocking virtualization case and the non-blocking installable path without requiring destructive WSL changes.

Is this the best way to solve the issue?

Yes. Reusing the existing classifier and downstream recovery behavior keeps readiness decisions in one place rather than adding a parallel Local AI-specific WSL policy.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against 309299b8f17b.

Labels

Label changes:

  • add rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • add status: needs maintainer proof decision: A ClawSweeper-authored PR needs a maintainer proof capture or override decision. Not applicable: The author is a collaborator, so external-contributor proof gating does not apply; the PR body nevertheless records current-head Windows computer-use observations and focused coverage for unsafe-to-force WSL states.
  • remove rating: 🐚 platinum hermit: Current PR rating is rating: 🦞 diamond lobster, so this older rating label is no longer current.
  • remove status: 👀 ready for maintainer look: Current PR status label is status: needs maintainer proof decision.

Label justifications:

  • P2: This is a bounded onboarding reliability fix rather than an active core-runtime outage.
  • merge-risk: 🚨 availability: The introduced early gate can prevent local gateway setup when WSL is classified as non-recoverably blocked.
  • rating: 🦞 diamond lobster: Overall readiness is 🦞 diamond lobster; proof is 🌊 off-meta tidepool and patch quality is 🦞 diamond lobster.
  • status: needs maintainer proof decision: A ClawSweeper-authored PR needs a maintainer proof capture or override decision. Not applicable: The author is a collaborator, so external-contributor proof gating does not apply; the PR body nevertheless records current-head Windows computer-use observations and focused coverage for unsafe-to-force WSL states.

Evidence

What I checked:

Likely related people:

  • Karen Lai: Introduced the merged recoverable-WSL behavior that this gate must preserve. (role: current WSL recovery contributor; confidence: high; commits: 4c078f9ee5f9; files: src/OpenClaw.SetupEngine/PreflightWslStep.cs)
  • Dallin Romney: Authored the merged Welcome-page WSL inspection and retry reliability work adjacent to this gate. (role: recent onboarding reliability contributor; confidence: high; commits: cb610b2b3d4e; files: src/OpenClaw.SetupEngine.UI/Pages/WelcomePage.xaml.cs)
  • Joel: Introduced the managed Local AI setup surface whose capability presentation this PR reorders. (role: Local AI feature introducer; confidence: medium; commits: ccd64bbb7d68; files: src/OpenClaw.SetupEngine.UI/Pages/CapabilitiesPage.xaml.cs)

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 (3 earlier review cycles)
  • reviewed 2026-08-21T23:49:15.529Z sha dcf0e3a :: needs maintainer review before merge. :: none
  • reviewed 2026-08-27T22:16:12.648Z sha 1a2fa7f :: needs maintainer review before merge. :: none
  • reviewed 2026-08-28T00:47:17.409Z sha 76e18bf :: needs maintainer review before merge. :: none

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

Copilot-Session: d327db5c-ee84-43f8-a425-060407f117c1
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 374d0354-6ac4-4e56-b3c5-1bfdff93a2fc
@karkarl
karkarl force-pushed the karkarl-gate-local-ai-on-wsl branch from dcf0e3a to 1a2fa7f Compare August 27, 2026 22:11
@clawsweeper clawsweeper Bot added the merge-risk: 🚨 availability 🚨 Merging this PR could cause crashes, hangs, restart loops, stalls, or process outages. label Aug 27, 2026
Co-authored-by: Copilot App <[email protected]>

Copilot-Session: 374d0354-6ac4-4e56-b3c5-1bfdff93a2fc
@karkarl

karkarl commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author

Adversarial release review

A dual-model Opus + Codex review examined the WSL readiness gate, same-window retry behavior, and integration with #1235 and #1202.

Reviewed SHA: 1a2fa7f3

Review result: SHIP AFTER FIXES. The runtime blocker was resolved, but the review required deterministic proof that refresh: true shares an incomplete inspection instead of starting duplicate work.

Finding addressed: Commit 76e18bfe adds a TaskCompletionSource-gated test proving the initial call and concurrent refresh share one in-flight task, then exactly one new inspection starts after completion. Focused tests, full build, Shared, Tray, and SetupEngine validation passed. Current-head CI is green.

Recommendation: READY TO MERGE with 98% merge confidence. Merge immediately after #1202.

The requested Hanselman skill was unavailable in the review runtime, so the installed equivalent adversarial workflow ran the same Opus + Codex review.

shanselman and others added 2 commits August 28, 2026 01:19
Preserve the merged one-shot WSL platform recovery while retaining the Local AI readiness gate and its single classification owner.

Co-authored-by: Copilot App <[email protected]>
@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision. 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. labels Aug 28, 2026
@shanselman shanselman removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Aug 28, 2026
@clawsweeper

clawsweeper Bot commented Aug 28, 2026

Copy link
Copy Markdown

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(setup): gate Local AI on WSL readiness This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@shanselman
shanselman merged commit fb14564 into main Aug 28, 2026
33 of 34 checks passed
@shanselman
shanselman deleted the karkarl-gate-local-ai-on-wsl branch August 28, 2026 09:50
@karkarl

karkarl commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator Author
image

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. P2 Normal priority bug or improvement with limited blast radius. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: needs maintainer proof decision A ClawSweeper-authored PR needs a maintainer proof capture or override decision.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants