Skip to content

fix(setup): verify WSL before Local AI downloads - #4

Closed
RomneyDa wants to merge 23 commits into
joelagnel:feature/local-ai-llama-server-code-onlyfrom
openclaw:fix/local-ai-virtualization-preflight
Closed

RomneyDa wants to merge 23 commits into
joelagnel:feature/local-ai-llama-server-code-onlyfrom
openclaw:fix/local-ai-virtualization-preflight

Conversation

@RomneyDa

Copy link
Copy Markdown

Summary

  • move the existing WSL install-and-verify stage ahead of Local AI runtime and model acquisition
  • fail before the 23 GB model download when WSL cannot start because hardware virtualization or Virtual Machine Platform is unavailable
  • keep the GPU compatibility check first, and align onboarding progress rows with the new execution order

This is a one-commit follow-up to openclaw#1178.

Validation

  • git diff --check - passed
  • .agents/skills/autoreview/scripts/autoreview --mode local - passed, no accepted/actionable findings
  • focused dotnet test - blocked locally because dotnet is unavailable on the macOS controller
  • required ./build.ps1, shared tests, and tray tests - blocked locally because no native Windows/Crabbox host is configured

Real behavior proof

Not verified / blocked locally: this path requires a Windows host with WSL absent or hardware virtualization disabled. The pipeline ordering tests assert that EnsureWslPlatformStep precedes both Local AI download steps, and the progress-page contract asserts the same visible phase order.

Rubber-duck review

The reviewer found that the progress UI still grouped early WSL verification with later WSL networking. The implementation now splits those phases and removes the stale “Verify Local AI before WSL setup” claim.

joelagnel and others added 23 commits August 20, 2026 14:51
Download, verify, extract, and install native archives atomically.
Clean stale staging only through no-follow app-owned path validation.

Signed-off-by: Joel Fernandes <[email protected]>
Persist installed runtime and model metadata with atomic file updates.
Give setup, startup, and cleanup one durable source of installation truth.

Signed-off-by: Joel Fernandes <[email protected]>
Host native Local AI processes with bounded startup and shutdown behavior.
Capture output and terminate owned process trees reliably on Windows.

Signed-off-by: Joel Fernandes <[email protected]>
Define immutable llama.cpp, CUDA, and GGUF catalog entries.
Pin versions, URLs, hashes, and hardware requirements for reproducible installs.

Signed-off-by: Joel Fernandes <[email protected]>
Select any NVML-backed NVIDIA adapter with a stable ID, compatible driver and CUDA, and enough memory for the chosen model.
Recommend the largest fitting model without GPU SKU allowlists or CPU/GPU pairing.

Signed-off-by: Joel Fernandes <[email protected]>
Load NVML from trusted locations and collect NVIDIA GPU capabilities.
Avoid unsafe library resolution while providing selector-grade hardware data.

Signed-off-by: Joel Fernandes <[email protected]>
Correlate NVML adapters with unambiguous DXGI memory observations and count shared memory for any NVIDIA GPU.

Fail closed on duplicate or ambiguous adapter names so model selection cannot borrow another device's budget.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Joel Fernandes <[email protected]>
Resume interrupted GGUF downloads with strict Range and Content-Range handling.
Verify size and hash before atomic promotion, restarting safely when resume is unsupported.

Signed-off-by: Joel Fernandes <[email protected]>
Install and inspect the pinned llama-server and CUDA runtime components.
Safely reconcile exact orphan runtime paths so interrupted promotion can retry.

Signed-off-by: Joel Fernandes <[email protected]>
Launch llama-server on demand with an OS-assigned or validated fixed port.
Prove listener ownership by child PID and start time before health checks or persistence.

Signed-off-by: Joel Fernandes <[email protected]>
Make Local AI opt-in and inspect hardware plus WSL viability without mutation.
Acquire verified native inference before WSL provisioning and resolve bundled defaults reliably from RID-specific output.

Signed-off-by: Joel Fernandes <[email protected]>
Reconcile and reuse only exact manifest-owned runtime and model artifacts after interruption.
Persist a proven healthy endpoint and clean durable app-owned state on fresh uninstall.

Signed-off-by: Joel Fernandes <[email protected]>
Probe health, execute real inference, and verify GPU activity on the owned endpoint.
Fail setup cleanly when the installed Local AI stack is not operational.

Signed-off-by: Joel Fernandes <[email protected]>
Use explicit 127.0.0.1 for Windows-to-WSL gateway connections and persisted setup state.
Remove only exact managed Local AI provider state during uninstall, preserving drift.

Signed-off-by: Joel Fernandes <[email protected]>
Bind Local AI to the singleton setup-managed distro resolved from the loaded gateway registry.
Quiesce exact provider state before transitions, then publish only healthy owned endpoints and compensate failures.

Signed-off-by: Joel Fernandes <[email protected]>
Surface Local AI eligibility, explicit consent, review, and setup progress.
Show native inference before WSL setup and describe dynamic multi-gigabyte disk use accurately.

Signed-off-by: Joel Fernandes <[email protected]>
Add Local AI navigation, status, controls, logs, and localized resources.
Wire the page through application services and retain focused UI contracts.

Signed-off-by: Joel Fernandes <[email protected]>
Keep a compact Local AI review visible when hardware, WSL, or networking blocks setup.
Hide unavailable controls and show every detected dependency reason through See why.

Co-authored-by: Karen Lai <[email protected]>
Signed-off-by: Joel Fernandes <[email protected]>
Accept full CUDA offload when either NVML memory movement or the parsed CUDA model buffer proves placement.
Reject startup when neither signal accounts for the selected model.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Joel Fernandes <[email protected]>
The consent InfoBar content sat flush against the bottom edge of the
warning, leaving the message and checkbox visually cramped. Add the
same bottom content margin the sandbox InfoBar already uses.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01L8LRNTZ5fBgjGwmtBCrSp3
Signed-off-by: Joel Fernandes <[email protected]>
Wait for the direct child process independently of redirected-pipe EOF, then bound the final output drain. Existing-distro inspection now fails closed when WSL times out or returns an unknown error.

Show progress during the Welcome-page inspection so a cold WSL service does not make setup look frozen.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

Signed-off-by: Joel Fernandes <[email protected]>
After an elevated WSL install fails, run a best-effort GitHub quota diagnostic and distinguish likely quota exhaustion from other download failures. Diagnostic timeouts never replace the original failure.

Offer Store, winget, and elevated PowerShell recovery routes, and allow the platform step to be retried.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>

Signed-off-by: Joel Fernandes <[email protected]>
@joelagnel

Copy link
Copy Markdown
Owner

Integrated into openclaw#1178 at 6f8dd82. The WSL readiness gate now runs before Local AI downloads, folded into the originating commits with Dallin attribution. Thank you—closing this fork PR as superseded.

@joelagnel joelagnel closed this Aug 21, 2026
@shanselman
shanselman deleted the fix/local-ai-virtualization-preflight branch September 7, 2026 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants