Repository navigation
fix(local-ai): make llama runtime validation deterministic - #1605
Conversation
|
🦞👀 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: needs maintainer review before merge. Reviewed October 2, 2026, 9:13 AM ET / 13:13 UTC (Revision 3). ClawSweeper reviewWhat this changesThe PR verifies downloaded llama runtime files by size and hash, repairs incomplete installations while retaining verified models, and checks the implementation library before startup. Merge readiness✅ Ready for maintainer review This PR remains useful: current main and the latest release still execute the runtime during installation validation. Inspection found no concrete introduced defect, and the member-authored work should remain open for landing. Priority: P2 Review scores
Verification
How this fits togetherCompanion's Local AI setup acquires pinned native runtime archives and model files, then records the installation for the runtime service. Inspection determines whether setup can reuse those files or must reacquire them before native startup. flowchart TD
A[Pinned runtime archives] --> B[Runtime acquisition]
B --> C[File size and hash inspection]
D[Existing installation] --> C
C --> E{Payload valid?}
E -->|No| B
E -->|Yes| F[Retain verified model and receipt]
F --> G[Native startup and health checks]
Before mergeNone. Agent review detailsSecurityNone. Review metrics
Technical reviewBest possible solution: Keep acquisition byte-verifiable, preserve verified models during runtime repair, and leave execution and health deadlines with the runtime owner. Do we have a high-confidence way to reproduce the issue? No deterministic live antivirus-timing reproduction is established. Current-main source confirms the executable-probe timeout and fatal incomplete-runtime path, while focused tests force the relevant failure states. Is this the best way to solve the issue? Yes. Checking pinned payload bytes within acquisition and retaining execution checks in the runtime owner is a focused solution that reuses the existing recovery and rollback pipeline. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 407bc7728826. LabelsLabel changes: No label changes. Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Summary
llama-server --versionprobe with deterministic size and SHA-256 verification of the complete runnable x64 and ARM64 payloadllama-server-impl.dllbefore native process startup, avoiding the Windows loader modalThe persistent loop had two parts. The installer executed the freshly extracted launcher as a validation probe, so first-use security scanning could turn acquisition into a timeout and partial rollback. A later normal setup pass treated that incomplete runtime as fatal instead of reacquiring it. Signing may still improve reputation and scan latency, but it is not required for correctness after this change.
Ownership is now explicit: archive acquisition establishes immutable source bytes, the runtime inspector verifies the installed runnable closure without executing it, and
StartLocalAiRuntimeStepowns native execution and health deadlines.Related: #1596 and openclaw/openclaw#163093. The signed-runtime publisher in #1603 remains separate defense in depth.
Required proof pools
windows-11-arm64: architecture-specific runtime manifests and native ARM64 build behavior changed.Validation
Current head
ce2be9d3:git diff --check: passedThe first Parallels attempt exposed a missing machine-wide ARM64 VC++ redistributable in the repository's unpackaged ONNX/native-load test host. That test path does not exercise Local AI's shipped runtime delivery: #1596 packages the three required VC runtime DLLs and stages them app-local beside
llama-server.exe, so the production Local AI path does not depend on a machine-wide redistributable. Installing the redistributable here was only a clean-VM validation prerequisite; afterward the native-load test and complete required validation rerun were green. The VM's automatic 128 GB memory sizing also exceeded available host backing space; the successful run used a fixed 64 GB allocation without changing the guest checkout or test commands.Real behavior proof
The current-head regression suite proves all three boundaries:
llama-server-impl.dll, a missing architecture-specific CPU backend, or a same-size byte replacement is rejected and returned to acquisition.Interactive reproduction of antivirus first-scan timing is not deterministic. The Parallels proof instead verifies the exact current-head Windows build and required suites, while the focused tests force each persistent-loop state directly.