Repository navigation
refactor(plugins): replace node-llama-cpp with managed llama-server - #123105
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Dependency GuardThis PR changes dependency-related files. Maintainers should confirm these changes are intentional. Changed files:
Maintainer follow-up:
|
Dependency graph changes notedThis PR includes dependency graph changes. The dependency guard is informational because the PR author is a repository admin or a member of
Security review is still recommended before merge when the dependency graph change is intentional. |
1647f59 to
ae8c4d6
Compare
|
Codex review: found issues before merge. Reviewed August 13, 2026, 7:34 PM ET / 23:34 UTC. ClawSweeper reviewWhat this changesThe PR replaces the llama.cpp plugin’s in-process node-llama-cpp runtime with a verified, supervised loopback llama-server for local chat and embeddings. Merge readinessKeep open for maintainer review. The current PR diff still removes the embedding export identified by the prior P1 review as necessary for released installed llama.cpp plugins, while the required current-tree, scoped-policy, and Codex-boundary checks could not run because the read-only sandbox fails before executing commands. Priority: P1 Review scores
Verification
How this fits togetherThe llama.cpp plugin provides OpenClaw’s local model and local embedding provider. Guided setup prepares server and model artifacts, the Gateway supervises the process, and chat plus memory clients use its loopback OpenAI-compatible endpoints. flowchart LR
A[Guided setup] --> B[llama.cpp plugin]
B --> C[Verified server and model artifacts]
C --> D[Gateway local-service supervisor]
D --> E[Loopback llama-server]
E --> F[Chat provider]
E --> G[Memory embeddings]
Decision needed
Why: The prior review identifies a concrete installed-plugin entrypoint failure, while deciding whether to preserve or intentionally retire that public compatibility surface requires maintainer ownership of the plugin SDK contract. Before merge
Findings
Agent review detailsSecurityNeeds attention: The managed binary-download and archive-extraction path is security-sensitive and could not receive the required current-head source review in this environment. Review metrics
Stored data modelPersistent data-model change detected: Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Keep one canonical managed-server runtime, but retain a deprecated loadable SDK bridge until released external llama.cpp plugin versions have a tested upgrade path; then remove it in a declared compatibility transition. Do we have a high-confidence way to reproduce the issue? Unclear: the prior review supplies a source-level installed-plugin failure path, but the current head and a released-plugin fixture could not be executed or inspected in this sandbox. Is this the best way to solve the issue? No: moving to one managed server path is coherent, but removing the loadable installed-plugin SDK path before proving the released-plugin upgrade boundary is not the safest implementation. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: unclear because the file could not be read completely. Codex review notes: model internal, reasoning high; reviewed against c574f403e947. LabelsLabel justifications:
EvidenceSecurity concerns:
What 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 (6 earlier review cycles)
|
ae8c4d6 to
952d0cf
Compare
5d0143e to
ae249e2
Compare
Move llama.cpp chat and local embeddings onto a verified externally managed llama-server runtime. Remove the in-process native runtime, forked embedding workers, and node-llama-cpp dependency while preserving guided setup, local GGUF models, tool-capable agent runs, diagnostics, and operator docs.
4a8ee9e to
bf94cce
Compare
|
Merged via squash.
|
The doctor-contract closure guard forbids the SSRF barrel in the doctor/legacy-setup closure (cold-loads DNS, proxy state, logging); the static import landed with the managed llama-server switch (#123105) and first fails when a PR selects the guard lane. Defer to a dynamic import at download time per the guard's stated remedy.
…123441) * feat(codex): pass explicit skill selections as structured turn input Thread OpenClaw-resolved explicit $skill selections through the reply pipeline to the Codex app-server harness and emit them as structured UserInput::Skill turn items when the Codex catalog (skills/list) knows the same SKILL.md path. Codex then injects the skill natively and blocks its text scanner from double-selecting the same name, while unmatched names stay scannable for Codex-native-only skills and the prompt instruction block keeps owning skills Codex cannot see. Catalog misses and RPC errors fail open to the instruction path; the turn never fails on skill lookup. Part of #123367 * fix(plugins): defer llama-cpp ssrf-runtime load out of the setup closure The doctor-contract closure guard forbids the SSRF barrel in the doctor/legacy-setup closure (cold-loads DNS, proxy state, logging); the static import landed with the managed llama-server switch (#123105) and first fails when a PR selects the guard lane. Defer to a dynamic import at download time per the guard's stated remedy.
…penclaw#123105) Move llama.cpp chat and local embeddings onto a verified externally managed llama-server runtime. Remove the in-process native runtime, forked embedding workers, and node-llama-cpp dependency while preserving guided setup, local GGUF models, tool-capable agent runs, diagnostics, and operator docs.
…penclaw#123441) * feat(codex): pass explicit skill selections as structured turn input Thread OpenClaw-resolved explicit $skill selections through the reply pipeline to the Codex app-server harness and emit them as structured UserInput::Skill turn items when the Codex catalog (skills/list) knows the same SKILL.md path. Codex then injects the skill natively and blocks its text scanner from double-selecting the same name, while unmatched names stay scannable for Codex-native-only skills and the prompt instruction block keeps owning skills Codex cannot see. Catalog misses and RPC errors fail open to the instruction path; the turn never fails on skill lookup. Part of openclaw#123367 * fix(plugins): defer llama-cpp ssrf-runtime load out of the setup closure The doctor-contract closure guard forbids the SSRF barrel in the doctor/legacy-setup closure (cold-loads DNS, proxy state, logging); the static import landed with the managed llama-server switch (openclaw#123105) and first fails when a PR selects the guard lane. Defer to a dynamic import at download time per the guard's stated remedy.
|
Hey @steipete, The mentioned model (Muse Glimme 30B) was already supported in I think you may have an npm policy to skip module updates from the past few days, which could explain why you didn't see an update when running Here are a few reasons why I think using
More generally, if there was something that |
Llama and llama.cpp now show up in `openclaw onboard` without installing `@openclaw/llama-cpp-provider` first, like LM Studio and Ollama. The plugin moved out of core when it depended on `node-llama-cpp`; since #123105 it manages a `llama-server` and its only runtime dependency is `@openclaw/fs-safe`, which core already ships. Follows the Cloudflare pattern (#174287): dropped from the root package's exclusion list, and its official catalog entry marked `bundledDist: true`, so it stays published to npm and ClawHub for standalone builds that omit it. The doctor and memory install hints are left as they are -- they only show when the plugin isn't loaded.
Llama and llama.cpp now show up in `openclaw onboard` without installing `@openclaw/llama-cpp-provider` first, like LM Studio and Ollama. The plugin moved out of core when it depended on `node-llama-cpp`; since openclaw#123105 it manages a `llama-server` and its only runtime dependency is `@openclaw/fs-safe`, which core already ships. Follows the Cloudflare pattern (openclaw#174287): dropped from the root package's exclusion list, and its official catalog entry marked `bundledDist: true`, so it stays published to npm and ClawHub for standalone builds that omit it. The doctor and memory install hints are left as they are -- they only show when the plugin isn't loaded.
What Problem This Solves
OpenClaw's local-model onboarding and local embeddings were built on the bundled
node-llama-cppin-process runtime. That wrapper pins an old llama.cpp build (b10068), so newer open-weight models — most recently Meta's Muse Glimmer 30B, whose architecture support merged upstream as llama.cpp PR #26841 — fail to load withunknown model architecture, and OpenClaw inherits the wrapper's full maintenance surface (about 61K lines of wrapper TypeScript plus native build glue) for functionality llama.cpp already ships asllama-server. Operators choosing the built-in local-model path were locked to the wrapper's release cadence and could not run current GGUF models.Why This Change Was Made
Replaces the in-process wrapper with a managed external
llama-server: the llama.cpp plugin now downloads a pinned, SHA-256-verified upstreamllama-serverrelease (b10357) for the operator's platform, downloads verified GGUF model artifacts, writes an INI model preset (chat + embedding), and lets OpenClaw's existinglocalServicesupervisor own the process lifecycle (lease refcounting, health polling, idle stop, restart) — the same supervisor other managed local services already use. Chat and embeddings talk to the server over the OpenAI-compatible HTTP API on loopback. This removes the entire wrapper layer (inference provider, runtime coordinator, native build orchestration, embedding worker host/child processes) instead of adding a second path, per the one-canonical-flow rule. Production LOC delta is −1,303 (tests +546/−3,175). Onboarding keeps the same guided flow, consent prompt, and progress reporting; only the engine underneath changes. The memory-core merge preserves main's newerMemorySearchOrchestrationhierarchy; the narrow local-embedding degradation behavior moved to its current lifecycle owner.User Impact
Operators running
openclaw configure/ first-run onboarding for the llama.cpp provider get the same one-prompt setup (verified download, ~5 GB default chat model + ~0.3 GB embedding model, RAM-floor check), now backed by current upstream llama.cpp — including support for new architectures like Muse Glimmer. Local memory embeddings keep working with unchanged index identity (legacy cache paths remain aliases, so no re-indexing). No config migration is required; stalenode-llama-cppconfig keys are normalized through the plugin's doctor contract.Evidence
/health,/models,/props,/metricsall report ready; PID reuse across calls; idle shutdown and clean restart; missing binary/model produce actionable doctor-style diagnostics.node scripts/run-vitest.mjs).OPENCLAW_TESTBOX=1 node scripts/check-changed.mjs): all stages green — format, npm lock guard (94 pkgs), doctor contract declaration/closure guard, bundled channel metadata, Plugin SDK API contract manifest, SDK package exports + surface budget, plugin boundaries, dead-export scan (0), database-first legacy-store guard, runtime sidecar loader guard, typecheck all, lint (0 errors), import cycles (0). Testbox run: https://github.com/openclaw/openclaw/actions/runs/31685190317