Skip to content

fix(plugin-sdk): installed llama providers fail to load after upgrade - #124041

Merged
fuller-stack-dev merged 2 commits into
mainfrom
fix/llama-cpp-provider-upgrade-compat
Aug 15, 2026
Merged

fuller-stack-dev merged 2 commits into
mainfrom
fix/llama-cpp-provider-upgrade-compat

Conversation

@fuller-stack-dev

@fuller-stack-dev fuller-stack-dev commented Aug 15, 2026 •

Copy link
Copy Markdown
Member

Related: #123105

AI-assisted: Codex investigated, implemented, and validated this change under maintainer direction. No agent transcript is attached.

What Problem This Solves

Fixes an issue where users upgrading OpenClaw across the managed llama-server cutover could have a previously installed @openclaw/llama-cpp-provider abort during ESM evaluation. The released provider imports createLocalEmbeddingProvider from the public plugin SDK, but that named export was removed before installed packages had converged, so plugin loading failed before registration or supported update repair could run.

Why This Change Was Made

This restores only a deprecated, load-only binding at the existing public SDK subpath. It always rejects with retirement and openclaw update repair guidance; it does not restore DEFAULT_LOCAL_MODEL, node-llama-cpp, its worker, or any in-process native runtime. The current provider remains exclusively backed by the separately managed llama-server CLI.

The regression coverage loads the exact released named-import shape through the real plugin loader/SDK alias boundary. An adjacent provider test proves invoking the bridge fails closed without model or server activity, while the existing current-provider tests continue to cover managed llama-server behavior.

The first exact-head CI run also exposed a current-main tooling regression from #124024: its new memory race test was missing from the test-project importer expectation. This PR includes the one-line expectation repair required to restore green main CI.

User Impact

An older installed llama.cpp provider can evaluate and register far enough for the supported update-repair flow to replace it. Until replacement, any attempt to invoke the retired in-process embedding path fails explicitly with the recovery command. After the managed provider is installed, repeated clean starts continue through llama-server without using this bridge.

Evidence

  • Red on unmodified canonical main: exact registry packages 2026.7.1 and 2026.7.2-beta.7 both failed with SyntaxError: ... does not provide an export named 'createLocalEmbeddingProvider'; current managed 2026.8.1-beta.2 loaded.
  • Exact proposed head: node scripts/run-vitest.mjs extensions/llama-cpp/index.test.ts src/plugins/loader.native-module-loader.test.ts — 2 files, 9 tests passed.
  • Exact proposed content on Blacksmith Testbox tbx_01m01w78ct6kcf7z6vepa1gqsz: check:changed passed SDK export/surface checks, typechecks, type-aware lint, plugin boundaries, dead-code, schema, sidecar, and import-cycle guards (exit 0, 15m41s). Local/Testbox SHA-256 values matched for all changed files and the newly changed lint-control files.
  • Source-blind package upgrade contract: C1-C5 passed with exact verified registry tarballs, lifecycle scripts disabled, the legacy optional native dependency omitted and import-denied, beta.7 import green, bridge rejection green, beta.2 replacement green, and a second clean-process start green. Run: https://github.com/openclaw/openclaw/actions/runs/31865520081
  • pnpm build passed on the retained Testbox, including all 145 public plugin SDK subpaths.
  • Current-main CI repair: node scripts/run-vitest.mjs src/scripts/test-projects.test.ts — 84 tests passed after adding the missing fix(memory): retain transcript updates during active sync #124024 importer expectation.
  • Mandatory autoreview: both the compatibility patch and the one-line CI repair were clean with no accepted/actionable findings (0.99 confidence).

@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@fuller-stack-dev
fuller-stack-dev marked this pull request as ready for review August 15, 2026 05:43
@clawsweeper clawsweeper Bot added merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. 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. labels Aug 15, 2026
@clawsweeper

clawsweeper Bot commented Aug 15, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 15, 2026, 1:54 AM ET / 05:54 UTC.

ClawSweeper review

What this changes

Adds a load-only SDK compatibility bridge for pre-managed llama.cpp provider packages and regression coverage for loading that legacy import through the installed-plugin loader.

Regression provenance

Possible regression — probable (reproduction; reviewed change). No predecessor PR is attributed.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

Keep open. The PR restores a removed named SDK export required for legacy installed provider evaluation, while preserving the managed llama-server runtime and giving an explicit repair path; no blocking patch defect was found.

Priority: P2
Reviewed head: e242ebaca5f7710a11c82450c5f25cfd78786d5a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused compatibility repair with direct loader-boundary coverage and no blocking review finding.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body additionally records a packaged upgrade-contract run and linked workflow evidence.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body additionally records a packaged upgrade-contract run and linked workflow evidence.
Evidence reviewed 6 items Current failure boundary: Current main exports the SDK subpath but has no createLocalEmbeddingProvider binding, so an installed ESM package requesting that named export fails during module evaluation before plugin registration.
Scoped compatibility repair: The proposed export rejects without importing or invoking the old native runtime and provides the supported repair command.
Real loader boundary coverage: The added fixture is an ESM packaged provider that imports the historical named export, and the test asserts the normal loader marks it loaded.
Findings None None.
Security None None.

How this fits together

Installed provider packages import OpenClaw Plugin SDK subpaths before the plugin loader can register them. The change restores evaluation compatibility at that boundary, then directs any retired embedding invocation to the managed-provider repair path.

flowchart LR
  A[Installed legacy provider] --> B[Plugin loader]
  B --> C[Plugin SDK subpath]
  C --> D[Load-only compatibility bridge]
  D --> E[Explicit update repair guidance]
  B --> F[Managed llama-server provider]
Loading

Before merge

  • Resolve merge risk (P1) - This reintroduces a retired public SDK name for an upgrade window; its removal must wait until supported managed-provider releases have replaced the affected installed packages.
  • Complete next step (P2) - No source defect requires automated repair; this maintainer-owned PR should proceed through normal exact-head CI and merge review.
Agent review details

Security

None.

PR surface

Source +14, Tests +83. Total +97 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 1 14 0 +14
Tests 3 83 0 +83
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 97 0 +97

Review metrics

Metric Value Why it matters
Production versus test LOC production +14, tests +83 The only production growth is the isolated load-only ABI bridge; the remaining additions prove loader and retired-runtime behavior.

Stored data model

Persistent data-model change detected: migration/backfill/repair: src/plugin-sdk/memory-core-host-engine-embeddings.ts, migration/backfill/repair: src/plugins/loader.native-module-loader.test.ts, serialized state: src/plugins/loader.native-module-loader.test.ts, vector/embedding metadata: extensions/llama-cpp/index.test.ts, vector/embedding metadata: src/plugin-sdk/memory-core-host-engine-embeddings.ts. Confirm migration or upgrade compatibility proof before merge.

Merge-risk options

Maintainer options:

  1. Accept the bounded compatibility window (recommended)
    Merge the rejecting bridge as a temporary public ABI restoration while the managed provider replaces affected installed packages.

Technical review

Best possible solution:

Land the narrowly rejecting bridge, retain the managed llama-server path as the sole runtime, and remove the bridge only after the published upgrade window is demonstrably closed.

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

Yes—source proves that current main lacks the named export while the added ESM fixture reproduces the installed-package import shape through the real loader boundary.

Is this the best way to solve the issue?

Yes. Restoring only the missing evaluation-time symbol at the existing SDK subpath is narrower than reviving the deleted native runtime or adding a second provider path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against f24bd8a2a299.

Labels

Label changes:

  • add P2: This fixes a bounded upgrade-time provider loading regression for users with an older installed llama.cpp package.
  • add merge-risk: 🚨 compatibility: The PR restores a deprecated Plugin SDK export for already-published packages, creating a temporary compatibility surface that needs a deliberate retirement point.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body additionally records a packaged upgrade-contract run and linked workflow evidence.

Label justifications:

  • P2: This fixes a bounded upgrade-time provider loading regression for users with an older installed llama.cpp package.
  • merge-risk: 🚨 compatibility: The PR restores a deprecated Plugin SDK export for already-published packages, creating a temporary compatibility surface that needs a deliberate retirement point.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-authored PR is exempt from the external-contributor proof gate; its body additionally records a packaged upgrade-contract run and linked workflow evidence.

Evidence

What I checked:

Likely related people:

  • steipete: Authored the merged managed llama-server migration that this PR explicitly follows up. (role: managed llama.cpp feature owner; confidence: high; commits: 134838707603; files: extensions/llama-cpp/index.ts, extensions/llama-cpp/src/embedding-provider.ts)
  • Peter Steinberger: Current-main blame attributes the managed provider registration and embedding adapter to this recent commit. (role: recent area contributor; confidence: medium; commits: 636fc9417109; files: extensions/llama-cpp/index.ts, extensions/llama-cpp/src/embedding-provider.ts, src/plugin-sdk/memory-core-host-engine-embeddings.ts)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Let the remaining exact-head checks complete before merge.

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.

@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Land-ready evidence for e242ebaca5f7710a11c82450c5f25cfd78786d5a:

ClawSweeper rank-up/merge-risk disposition: exact-head checks are complete. I accept the recommended bounded compatibility window; the bridge is deprecated, always rejects instead of restoring node-llama-cpp, and its code comment requires managed latest and extended-stable replacement plus the upgrade-window close before removal.

Production LOC: +14/-0; tests: +83/-0. Proof gap: no live fleet deployment was run, by design; the deterministic installed-package/loader boundary was exercised with exact registry artifacts in isolation.

@fuller-stack-dev
fuller-stack-dev merged commit a02ed2c into main Aug 15, 2026
197 checks passed
@fuller-stack-dev
fuller-stack-dev deleted the fix/llama-cpp-provider-upgrade-compat branch August 15, 2026 05:57
@fuller-stack-dev

Copy link
Copy Markdown
Member Author

Merged via squash.

steipete added a commit that referenced this pull request Aug 15, 2026
…r upgrade (#124086)

* fix(plugin-sdk): keep published pre-split plugin imports loading after upgrade

Same bug class as #124041: published plugin artifacts import SDK names at
module top level, so removing them from the barrel makes the installed
plugin fail to load (voice-call/matrix doctor contracts silently never run
their migrations; whatsapp and slack channels fail outright) after a core
upgrade. Verified against the actual npm tarballs (2026.7.2-beta.7):

- openclaw/plugin-sdk/runtime-doctor: voice-call + matrix doctor contracts
  import repair names (archiveLegacyStateSource, detect/repair state DB
  schema, plugin install-path repair, removePluginFromConfig,
  createPluginStateSyncKeyedStore) that moved to doctor-repair-runtime.
- openclaw/plugin-sdk/channel-feedback: whatsapp imports
  shouldAckReactionForWhatsApp (owner policy moved in-plugin by #121257).
- openclaw/plugin-sdk/channel-outbound: slack imports
  resolveChannelProgressDraftRender (render key retired by #122927).

Adds deprecated load-only bridges with named removal windows, bumps the
SDK surface budgets with comments, and locks behavior with unit tests
plus a loader fixture that fails without the bridges.

* test(plugin-sdk): cover the repair bridge in the runtime-doctor facade surface lock
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…openclaw#124041)

* fix(plugin-sdk): let installed llama providers load after upgrade

* test(tooling): include new memory race importer
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 16, 2026
…r upgrade (openclaw#124086)

* fix(plugin-sdk): keep published pre-split plugin imports loading after upgrade

Same bug class as openclaw#124041: published plugin artifacts import SDK names at
module top level, so removing them from the barrel makes the installed
plugin fail to load (voice-call/matrix doctor contracts silently never run
their migrations; whatsapp and slack channels fail outright) after a core
upgrade. Verified against the actual npm tarballs (2026.7.2-beta.7):

- openclaw/plugin-sdk/runtime-doctor: voice-call + matrix doctor contracts
  import repair names (archiveLegacyStateSource, detect/repair state DB
  schema, plugin install-path repair, removePluginFromConfig,
  createPluginStateSyncKeyedStore) that moved to doctor-repair-runtime.
- openclaw/plugin-sdk/channel-feedback: whatsapp imports
  shouldAckReactionForWhatsApp (owner policy moved in-plugin by openclaw#121257).
- openclaw/plugin-sdk/channel-outbound: slack imports
  resolveChannelProgressDraftRender (render key retired by openclaw#122927).

Adds deprecated load-only bridges with named removal windows, bumps the
SDK surface budgets with comments, and locks behavior with unit tests
plus a loader fixture that fails without the bridges.

* test(plugin-sdk): cover the repair bridge in the runtime-doctor facade surface lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

extensions: llama-cpp maintainer Maintainer-authored PR merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: S 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