Skip to content

refactor(llama-cpp): adopt canonical runtime owners - #126371

Merged
steipete merged 1 commit into
mainfrom
steipete/f2-llama-canonical
Aug 19, 2026
Merged

steipete merged 1 commit into
mainfrom
steipete/f2-llama-canonical

Conversation

@steipete

Copy link
Copy Markdown
Contributor

Related: #125781

What Problem This Solves

The external llama-server feature landed with several plugin-local implementations of behavior that already has canonical OpenClaw owners: live catalog caching, bounded concurrency, insertion-order map pruning, auth-profile removal, and record coercion. Keeping those copies would let the plugin drift from the shared runtime policies over time.

This is a post-land canonicalization requested by the maintainer audit, not a criticism of the feature work. Thanks to @osolmaz for building and proving the external llama-server integration in #125781.

Why This Change Was Made

The llama-server plugin now delegates each shared invariant to its existing owner while retaining the same endpoint, credential, cache, scheduling, and cleanup behavior.

Family Canonical owner adopted Preserved behavior
Discovery cache getCachedLiveCatalogValue 30,000 ms default TTL, success-only retention, credentialed bypass, 100-entry bound
Dynamic model scopes pruneMapToMaxSize delete-then-set refresh ordering and 100-scope insertion-order eviction
Auth-profile removal removeAuthProfilesWithLock via the existing provider removal seam exact llama-server:default deletion from profiles, usage, order, and last-good state; unrelated profiles remain
Router property probes runTasksWithConcurrency at most 8 concurrent probes, at most 200 models, one total deadline, ordered results, stop/throw on unexpected failures
Record boundaries asOptionalRecord / isRecord arrays and primitives remain rejected; valid header/model records retain their prior normalization

The provider removal seam gained an optional exact-profile narrowing and delegates that path to the selected-profile owner. This avoids adding another public Plugin SDK callable or increasing the shrink-only SDK surface budget.

User Impact

No user-visible behavior changes. Existing external llama-server discovery, setup, authentication, dynamic models, and router metadata should behave identically, with shared owners now enforcing the policies.

Production LOC: +87/-139 (net -52). Tests: +299/-12 (net +287).

Evidence

  • node scripts/run-vitest.mjs extensions/llama-cpp/src/external-server src/agents/auth-profiles/profiles.test.ts src/plugin-sdk/provider-catalog-shared.test.ts src/utils/run-with-concurrency.test.ts — 11 files, 126 tests passed.
  • node scripts/check-changed.mjs — passed core + core tests + extension + extension tests, including formatting, typechecks, lint, coercion, boundaries, dead exports, and import cycles.
  • .agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output — clean; no accepted/actionable findings.
  • Added 15 focused cases: 10 cache/concurrency/eviction cases and 5 record-boundary cases.

@clawsweeper

clawsweeper Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@openclaw-barnacle openclaw-barnacle Bot added agents Agent runtime and tooling extensions: llama-cpp size: L maintainer Maintainer-authored PR labels Aug 19, 2026
@steipete
steipete marked this pull request as ready for review August 19, 2026 17:04
@steipete
steipete requested a review from a team as a code owner August 19, 2026 17:04
@steipete

Copy link
Copy Markdown
Contributor Author

Land-ready verification complete for 62eccac7bd0d4e627f474718d509f04d47aa46e7.

  • Canonical owners adopted for live catalog caching, bounded concurrency, map pruning, selected auth-profile removal, and record coercion; behavior limits are tabled in the PR body.
  • Production LOC: +87/-139 (net -52). Tests: +299/-12.
  • node scripts/run-vitest.mjs extensions/llama-cpp/src/external-server src/agents/auth-profiles/profiles.test.ts src/plugin-sdk/provider-catalog-shared.test.ts src/utils/run-with-concurrency.test.ts — 11 files, 126 tests passed.
  • node scripts/check-changed.mjs — passed core, core-test, extension, and extension-test gates.
  • .agents/skills/autoreview/scripts/autoreview --mode local --stream-engine-output — clean; no accepted/actionable findings.
  • Exact-head CI: https://github.com/openclaw/openclaw/actions/runs/32279547707 — green.
  • OPENCLAW_TESTBOX=1 scripts/pr prepare-run 126371 — passed with hosted_exact_or_recent_parent; head unchanged.

Proof gap: ClawSweeper has not published a review comment, so there are no rank-up moves or technical P1 findings available to address. The publisher is non-blocking under the repository landing policy.

@steipete
steipete merged commit 7c1779e into main Aug 19, 2026
288 checks passed
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@steipete
steipete deleted the steipete/f2-llama-canonical branch August 19, 2026 17:18
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling extensions: llama-cpp maintainer Maintainer-authored PR size: L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant