Repository navigation
fix(setup): allow Local AI setup on busy GPUs and current Gateway - #1399
Conversation
Use CanInstall for capability selection and preflight. Preserve the qualified model and profile under transient VRAM pressure. Local stack: land together with the following commit removing mandatory inference proof from setup. Issue openclaw#1391.
Move GPU baseline, inference and GPU-load checks into an opt-in proof factory. Keep artifact verification, empty-router readiness, non-autoloading WSL checks and gateway wiring. Make setup progress and completion copy truthful. Validated with full build, Shared 3993 passed/34 skipped, Tray 2899 passed, SetupEngine 1139 passed. Combined setup autoreview clean. Issue openclaw#1391.
|
🦞👀 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: blocked before merge. Reviewed September 10, 2026, 8:27 PM ET / September 11, 2026, 00:27 UTC (Revision 6). ClawSweeper reviewWhat this changesAllows Local AI installation on supported busy GPUs, defers model loading until use, and updates Gateway configuration reads and batch writes for current CLI formats. Merge readiness⛔ Blocked before merge - 2 items remain This PR remains necessary: current main retains both setup blockers. No introduced correctness or security defect was found. The recorded behavior proof is sufficient, but required non-skipping MXC validation and the maintainer's draft hold remain unresolved. Priority: P0 Review scores
Verification
How this fits togetherThe Windows setup wizard installs a local model and starts its managed inference router. Setup and the tray application's provider coordinator then configure the WSL Gateway to route requests to that router while preserving prior model settings. flowchart LR
A[GPU capabilities and memory] --> B[Setup eligibility]
B --> C[Install model and start empty router]
C --> D[Check WSL reachability]
D --> E[Read Gateway settings]
E --> F[Validate and apply configuration]
F --> G[Load model on first request]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Keep installation based on supported GPU capacity, retain router and configuration safeguards, and leave actionable load-time recovery UX with its separate tracked work. Do we have a high-confidence way to reproduce the issue? Yes: current-main source deterministically rejects supported busy GPUs and uses the incompatible Gateway read/batch formats documented in the linked report. This review did not execute the application. Is this the best way to solve the issue? Yes: the patch uses the existing CanInstall contract and established stdin/temporary-file pattern while preserving integrity, ownership, and rollback checks. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 7dab793673ff. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (5 earlier review cycles)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
hey @shanselman , the proof was posted above, any other proof needed? |
MXC validation status: environment-blocked, not a PR defectAttempted real (non-
The E2E harness intentionally isolates test WSL distros under Given ClawSweeper's |

What Problem This Solves
Fixes an issue where users setting up Local AI on a supported GPU would have installation blocked when another application temporarily occupied VRAM. Also fixes setup and managed-provider failures with current Gateway config CLI output and batch-file handling.
Addresses the setup portion of #1391. Fixes #1398.
Why This Change Was Made
Installation eligibility should use GPU capabilities and total supported memory, not require enough free VRAM to load the model during onboarding. Model loading remains deferred until use.
This PR contains exactly three contributor-authored commits:
c5f6e740: allow supported-but-busy GPUs through Local AI selection and hardware preflight.69d4e85b: remove model-loading/inference proof steps from the installation pipeline, retain them as opt-in diagnostics, and describe completion as installed rather than inference-verified.9add27bc: support known legacy stderr and current structured stdout unset-config errors, and send Gateway config batches through a regular temporary file. One shared parser owns the exact error recognition across setup snapshots, workspace resolution, and the runtime provider coordinator.Unknown config paths, operational errors, malformed responses, timeout checks, size limits, ownership checks, and rollback protections remain fail-closed. The final parser extraction removes 22 production lines and preserves behavior.
Non-goals: no new OOM chat UI, no changed post-setup model-load error UX, and no Gateway version-policy change. Diagnostic proof harnesses remain local-only and are not part of this branch.
User Impact
Users can download and complete Local AI setup while a capable GPU is temporarily busy. Setup still installs and starts the managed router, but does not load the model to prove inference. Actual inference still requires sufficient memory when the model loads.
Required proof pools
windows-wsl-dgx-blackwell: contributor hardware proof on the exact remote head, with RTX 5090 temporary VRAM pressure and successful inference after pressure release.windows-wsl-gateway-e2e: exact-head CI setup/connect E2E passed against currentmain; current Gateway 2026.9.3 publication/restoration was also exercised live on isolated port 18790.windows-winui-interactive: contributor screenshot/comment on the exact remote head demonstrates completed setup and deferred model-load failure.Validation
The contributor head remains
9add27bc2ffed3b87fdceac334cbad84158d0e6e. No maintainer commit was pushed, preserving Joel/@joelagnel's exact-head proof and attribution.GitHub's exact-head PR test merge used current
mainat7dab793673ff00a43fd74259ed83321894ef601efrom #1397 (feat(local-ai): safely use the standard Hugging Face hub cache). CI run 34537565845 is green for the CI Gate, Core and CLI tests, Tray/setup/integration tests, UI/functional/accessibility tests, Setup and connect E2E, Revocation recovery E2E, Network recovery E2E, fast validation, and proof-pool contracts.Maintainer integration head
f390967db41909332501002ee7cf905dc021bf90is a local-only clean merge of7dab7936into9add27bc. It was not pushed because the effective 13-file PR delta merges cleanly and no attributable blocking defect was found.f390967d.\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.SetupEngine.Tests\OpenClaw.SetupEngine.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Connection.Tests\OpenClaw.Connection.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -r win-x64dotnet test .\tests\OpenClawTray.FunctionalUI.Tests\OpenClawTray.FunctionalUI.Tests.csproj -r win-x64OPENCLAW_RUN_INTEGRATION=1Tray integration suitepython .agents\skills\autoreview\scripts\autoreview --mode branch --base origin/mainThe reported Shared/CLI failures were reproduced and classified rather than hidden:
DeviceIdentityFailClosedTests.OperatorCli_WhenPersistedIdentityIsCorrupt_ReturnsSafeFailureWithoutStackTracepassed 2/2 on the PR and current main.McpHttpServerTests.Dispose_DuringInFlightHandler_DoesNotSurfaceObjectDisposedExceptionintermittently observed an unhandledObjectDisposedExceptionrace in full-suite execution. It also reproduces on current main, passed 10/10 focused reruns after the latest failure, and a fullf390967dShared rerun passed 3,991/3,991 non-skipped tests. This is not attributable to this PR.validate-mxc-e2e.ps1reached the setup fixture, then failed before any PR-specific or MXC assertion because the host WSL fresh-install path could not attach its temporaryswap.vhdx(Access is denied). Eleven tests passed and six fixture-dependent tests failed. The exact-head CI Setup and connect E2E lane is green, and an earlier hardware run passed all 17 MXC tests with no skips.Real behavior proof
Exact-head busy-GPU setup
Joel's proof comment was posted after final contributor head
9add27bcand explicitly records that setup completed while model loading remained deferred to inference. The attached screenshot shows the connected application and the deferredAgent errorduring temporary memory pressure. The recorded run used Windows x64, Gateway 2026.9.3, and an NVIDIA RTX 5090 with a 24 GiB allocation held during onboarding:This is the required busy-GPU behavior: install eligibility depends on supported total GPU memory, while actual model loading remains deferred until first use.
Live current Gateway 2026.9.3 lifecycle
Maintainer proof used isolated Node 24.16.0, OpenClaw Gateway
2026.9.3 (1391f7c), isolated state, and a live Gateway listening on127.0.0.1:18790. No user Gateway config or port 18789 process was modified.Config path is valid but unset:models.providers.llamacppandagents.defaults.model.primary.config set --batch-file ... --dry-run --jsonwith two operations, schema validation, and complete resolvability.llamacppprovider and selectedllamacpp/qwen3.8-27b-mtp-ud-q4-k-m.openai/gpt-5.6-sol; provider withdrawal succeeded; the running Gateway hot-reloaded both changes.openai/gpt-5.6-sol, the provider again returned the exact structured unset response with exit code 1, andconfig validatepassed.Repository tests additionally assert the production coordinator sends its shell script through
/bin/sh -sstdin, writes the batch to a regularmktempfile, performs dry-run before apply, and cleans the file on exit.Integration with current main
f390967dmerges currentmainfrom #1397 (feat(local-ai): safely use the standard Hugging Face hub cache) into the contributor head without conflicts. The combined tree built and passed the targeted Local AI, setup, connection, WinUI, functional UI, tray integration, and mandatory Tray suites. The PR's effective source/test delta remains the contributor's 13 files.Review
ClawSweeper Revision 3 reviewed
9add27bcagainst currentmainand reported no code or security finding. Its remaining asks were current-head behavior, Gateway lifecycle, and validation provenance, supplied above.Final structured autoreview reported no accepted/actionable findings. Independent rubber-duck review found no merge blocker and confirmed the busy-GPU, parser, batch transport, rollback ownership, and merged-base behavior. It noted one non-blocking diagnostic-quality edge case: an unknown config-read failure during uninstall can surface an internal parser exception after failing closed. That does not weaken ownership checks, permit unsafe removal, or affect the setup/runtime paths fixed here, so it is not used to stale the proven contributor head.
Security Impact
/dev/stdinbatch to a temporary regular file with cleanup; scripts go over stdin rather than shell-expanded argv. Validation runs before mutation. Existing managed-route ownership and rollback behavior remain intact.Compatibility and Migration