Skip to content

fix(local-ai): stage VC runtime beside llama server - #1596

Merged
RomneyDa merged 3 commits into
mainfrom
openclaw/windows-local-ai-dll-loading-issue
Oct 2, 2026
Merged

RomneyDa merged 3 commits into
mainfrom
openclaw/windows-local-ai-dll-loading-issue

Conversation

@RomneyDa

@RomneyDa RomneyDa commented Oct 2, 2026 •

Copy link
Copy Markdown
Member

Summary

  • package the required VC runtime DLLs in a private nested MSIX payload
  • stage those DLLs app-local beside the downloaded llama-server runtime
  • repair existing Local AI installs during reconciliation without mutating read-only inspection
  • preserve unpackaged ARM64 development by falling back to the architecture-correct Windows system runtime
  • require the staged files in Windows runtime health checks

This is the Companion SetupEngine counterpart to openclaw/openclaw#163093. The Gateway fix does not cover the llama-server downloaded and launched by the Windows Companion.

Required proof pools

  • windows-11-arm64: completed on isolated Windows 11 ARM64 at head a8666a1c. Built the Store MSIX, inspected its nested runtime payload, and launched the pinned ARM64 llama-server with those packaged DLLs staged app-local.
  • windows-clean-installer-upgrade: not selected. This does not change app install, upgrade, repair, or uninstall behavior. Existing Local AI component repair is covered by the current-head reconciliation test below, including receipt preservation.

Validation

Isolated Windows 11 ARM64, head a8666a1c:

  • ./build.ps1: passed
  • OpenClaw.Shared.Tests: 4,221 passed, 36 skipped, 0 failed
  • OpenClaw.Tray.Tests: 3,862 passed, 0 failed
  • focused SetupEngine staging and reconciliation tests: 7 passed, 0 failed
  • unpackaged ARM64 default fallback test copied and byte-compared the installed System32 runtime through the production constructor
  • rubber-duck re-review: no P0-P2 findings
  • git diff --check: passed

The first Tray run exposed a missing Microsoft ARM64 VC++ redistributable in the VM through the pre-existing ONNX load test. After installing that prerequisite, the failed test passed and every subsequent full required validation run was green.

Real behavior proof

Current-head Windows 11 ARM64 proof:

  1. Built OpenClaw-arm64.msix with Build-StoreMsix.ps1 from a8666a1c.
  2. Confirmed the package contains:
    • tools/local-ai-vc-runtime/msvcp140.dll
    • tools/local-ai-vc-runtime/vcruntime140.dll
    • tools/local-ai-vc-runtime/vcruntime140_1.dll
  3. Downloaded the pinned b11026 ARM64 runtime and CUDA dependency archives and verified both catalog SHA-256 values.
  4. Extracted the three DLLs from the exact-head MSIX beside the pinned llama-server runtime.
  5. Ran llama-server.exe --version successfully. It exited 0 and reported:
version: 0.4.1-dev (build 11026, commit b49650adb)
built with Clang 20.1.8 for Windows arm64

The ARM VM has no CUDA device, so llama emitted its expected CUDA initialization diagnostic before returning the version.

Existing-install repair is covered by Reconciler_StagesVcRuntimeForExistingInstall_WithoutMutatingReceipt: it exercises the production staging owner against an existing managed runtime, verifies all three files are copied before inspection, and verifies the receipt is unchanged. ReadOnlyInspection_DoesNotStageVcRuntime separately protects the passive inspection boundary.

The unpackaged ARM64 compatibility path is covered twice: an injected architecture-matched system directory test verifies source selection, and a Windows-only test invokes the production constructor against Environment.SystemDirectory and byte-compares all three staged DLLs.

@clawsweeper

clawsweeper Bot commented Oct 2, 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.

@RomneyDa RomneyDa added the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 2, 2026
@clawsweeper clawsweeper Bot added P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Codex review: needs maintainer review before merge. Reviewed October 2, 2026, 2:36 AM ET / 06:36 UTC (Revision 4).

ClawSweeper review

What this changes

Package Visual C++ runtime DLLs and stage them beside the downloaded Local AI server during installation and repair, with a Windows system-runtime fallback for unpackaged builds.

Merge readiness

✅ Ready for maintainer review

The prior ARM64 fallback and MSIX fixture findings are resolved. No remaining actionable defect was found, and this distinct Companion fix is still needed on main.

Priority: P2
Reviewed head: a8666a1ce4a66721c66633a9a75bd441052a6ce0

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The focused implementation resolves prior findings and has relevant current-head native proof plus reported full Windows validation.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): Exact-head ARM64 MSIX payload inspection and successful pinned llama-server --version after app-local staging demonstrate the changed native dependency-loading behavior. Production-constructor Windows fallback and reconciliation tests supplement this with source-selection, receipt-preservation, and passive-inspection coverage. No stored-data contract changes are introduced.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): Exact-head ARM64 MSIX payload inspection and successful pinned llama-server --version after app-local staging demonstrate the changed native dependency-loading behavior. Production-constructor Windows fallback and reconciliation tests supplement this with source-selection, receipt-preservation, and passive-inspection coverage. No stored-data contract changes are introduced.
Evidence reviewed 9 items Introduced change and continued necessity: The pinned main-to-head diff adds dependency staging to installation and reconciliation, private MSIX payload delivery, and health-check requirements. Main's installer has no corresponding staging step.
Prior ARM64 finding resolved: Source selection now prefers the packaged payload, then application-base DLLs, then Environment.SystemDirectory. The new injected fallback and production-constructor Windows tests cover the previous missing-payload configuration. GitHub's comparison against the earlier reviewed head independently confirms these additions.
Packaging fixture repaired: The synthetic MSIX fixture now supplies all three newly required nested DLL entries, matching Build-StoreMsix.ps1. The production publish target reuses the existing architecture-specific Visual Studio runtime resolver.
Findings None None.
Security None None.

How this fits together

The Windows Companion downloads and manages a native llama-server for Local AI. SetupEngine stages its dependencies and checks the executable before the installation is reused or started.

flowchart TD
    A[Packaged runtime DLLs] --> D[Select complete runtime source]
    B[App directory DLLs] --> D
    C[Windows system DLLs] --> D
    D --> E[Stage beside Local AI server]
    F[New or existing installation] --> E
    E --> G[Check files and native version]
    G --> H[Accept or report installation failure]
Loading

Before merge

None.

Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Production and test delta production +173/-6; tests +187/-3; packaging scripts +8/-2 Production growth provides a focused dependency-staging owner with corresponding repair, fallback, and packaging coverage.

Technical review

Best possible solution:

Keep dependency staging within SetupEngine, preserve passive inspection and existing receipts, and retain architecture-correct unpackaged fallback.

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

Yes, source establishes the missing app-local dependency path for downloaded llama-server outside the MSIX package graph; the supplied Windows proof exercises native loading after staging. This reviewer did not execute a failing main build.

Is this the best way to solve the issue?

Yes, reusing existing architecture-specific runtime packaging and adding a focused staging owner addresses the dependency boundary without changing receipts or introducing another installer.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 85f66247850e.

Labels

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Exact-head ARM64 MSIX payload inspection and successful pinned llama-server --version after app-local staging demonstrate the changed native dependency-loading behavior. Production-constructor Windows fallback and reconciliation tests supplement this with source-selection, receipt-preservation, and passive-inspection coverage. No stored-data contract changes are introduced.
  • remove merge-risk: 🚨 compatibility: Current PR review selected no merge-risk labels.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.
  • remove status: ⏳ waiting on author: Current PR status label is status: 👀 ready for maintainer look.

Label justifications:

  • P2: This is a bounded Local AI native-dependency repair with current-head ARM64 evidence and no established urgent regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Exact-head ARM64 MSIX payload inspection and successful pinned llama-server --version after app-local staging demonstrate the changed native dependency-loading behavior. Production-constructor Windows fallback and reconciliation tests supplement this with source-selection, receipt-preservation, and passive-inspection coverage. No stored-data contract changes are introduced.
  • proof: sufficient: Contributor real behavior proof is sufficient. Exact-head ARM64 MSIX payload inspection and successful pinned llama-server --version after app-local staging demonstrate the changed native dependency-loading behavior. Production-constructor Windows fallback and reconciliation tests supplement this with source-selection, receipt-preservation, and passive-inspection coverage. No stored-data contract changes are introduced.

Evidence

What I checked:

  • Introduced change and continued necessity: The pinned main-to-head diff adds dependency staging to installation and reconciliation, private MSIX payload delivery, and health-check requirements. Main's installer has no corresponding staging step. (src/OpenClaw.SetupEngine/LlamaRuntimeInstaller.cs:151, a8666a1ce4a6)
  • Prior ARM64 finding resolved: Source selection now prefers the packaged payload, then application-base DLLs, then Environment.SystemDirectory. The new injected fallback and production-constructor Windows tests cover the previous missing-payload configuration. GitHub's comparison against the earlier reviewed head independently confirms these additions. (src/OpenClaw.SetupEngine/LocalAiVcRuntimeStager.cs:24, a8666a1ce4a6)
  • Packaging fixture repaired: The synthetic MSIX fixture now supplies all three newly required nested DLL entries, matching Build-StoreMsix.ps1. The production publish target reuses the existing architecture-specific Visual Studio runtime resolver. (scripts/test-msix-ci-artifacts.ps1:61, a8666a1ce4a6)
  • Current-head native proof: The supplied complete PR body, captured with sourceRevision b2bf0b3b60038a19eab33302881fbcefd967ff8fe7ef07a1c0633c1e823ee314, reports an exact-head ARM64 MSIX containing the three DLLs, catalog-hash-verified native archives, and successful llama-server --version after staging those packaged DLLs beside the executable. Output identifies build 11026 and commit b49650adb. This directly exercises native loading relevant to the production inspector, rather than unrelated application startup. (src/OpenClaw.SetupEngine/LlamaRuntimeInstaller.cs:297, a8666a1ce4a6)
  • Existing-install and passive-inspection boundaries: Reconciliation stages dependencies only after recipe/path validation; passive InspectAsync remains read-only. Added regression coverage verifies existing-install reuse, unchanged receipt bytes, and absence of staging during passive inspection. No serialized receipt or schema contract changes are introduced. (tests/OpenClaw.SetupEngine.Tests/LocalAiInstallRecoveryTests.cs:999, a8666a1ce4a6)
  • Validation and review limitations: The captured body reports a successful full Windows build, 4,221 Shared tests passed with 36 skipped, 3,862 Tray tests passed, seven focused SetupEngine tests passed, and rubber-duck re-review. This read-only review did not execute builds or tests. Some historical blobs were unavailable locally; GitHub comparison supplied the prior-head delta. Final git status was clean. (a8666a1ce4a6)

Likely related people:

  • larroy: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • shanselman: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

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-10-02T05:58:00.250Z sha 1cfa5c9 :: blocked before merge. :: [P2] Update the synthetic MSIX payload for the new required DLLs
  • reviewed 2026-10-02T06:07:13.232Z sha 1695025 :: blocked before merge. :: none
  • reviewed 2026-10-02T06:16:16.457Z sha 1695025 :: blocked before merge. :: [P2] Provide a VC payload for unpackaged ARM64 builds

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@RomneyDa

RomneyDa commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

Current-head Windows validation and ARM64 MSIX plus native llama-server proof are now in the PR body. The existing-install reconciliation evidence and proof-pool declaration are also updated.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels Oct 2, 2026
@RomneyDa

RomneyDa commented Oct 2, 2026

Copy link
Copy Markdown
Member Author

@clawsweeper re-review

The unpackaged ARM64 finding is fixed at a8666a1c: packaged and app-base sources remain preferred, with Environment.SystemDirectory as the architecture-correct final fallback. Injected and real-Windows fallback tests pass, full required Windows validation is green, and the exact-head MSIX/native llama proof is refreshed in the PR body.

@clawsweeper

clawsweeper Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added 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. and removed merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Oct 2, 2026
@RomneyDa
RomneyDa merged commit 4c9a7a8 into main Oct 2, 2026
59 of 63 checks passed
@RomneyDa
RomneyDa deleted the openclaw/windows-local-ai-dll-loading-issue branch October 2, 2026 07:16
@RomneyDa RomneyDa removed the status: 🚢 actively landing A maintainer or agent is actively driving this item through implementation, validation, or merge. label Oct 2, 2026
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. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant