Repository navigation
fix(llama-cpp): preserve live router model limits and tools on refresh - #168309
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: blocked before merge. What this changesThis PR separates unverified setup metadata from runtime defaults and carries refreshed llama.cpp model facts into agent resolution. Example: Qwen3-0.6B is unloaded during setup and later loaded with a 32,768-token context.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Partial Merge readiness⛔ Blocked before merge - 1 item remains Keep open: this maintainer-authored PR repairs a confirmed router-discovery bug, with no actionable code findings in the reviewed patch. Priority: P2 Before merge
FindingsNone. Tests
Agent review detailsHow this fits togetherThe llama.cpp plugin discovers server models and properties, publishes runtime catalog entries, and supplies model limits and capabilities to the shared agent resolver. flowchart LR
A[Existing llama server] --> B[Guarded discovery]
B --> C[Plugin model mapper]
C --> D[Setup configuration]
C --> E[Runtime catalog]
D --> F[Agent model resolver]
E --> F
F --> G[Agent request]
Technical reviewBest possible solution: Keep the route-scoped repair and explicit override preservation, with latest-stable saved-configuration compatibility demonstrated before merge. Do we have a high-confidence way to reproduce the issue? Current-main source confirms that skipped unloaded rows acquire fallback values that setup persists; the linked report independently documents the resulting tool failure. Is this the best way to solve the issue? The repair addresses the metadata producer and shared resolver while preserving non-loading discovery, explicit pins, and route ownership. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 123d5a1331a8. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +23, Tests +216, Docs +19. Total +258 across 16 files. Added test files: 1. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (4 earlier review cycles)
Reviewed October 10, 2026, 6:58 AM ET / 10:58 UTC (Revision 5). |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
openclaw#168309) * fix(llama-cpp): keep unverified router facts out of setup config * fix(models): admit deferred local catalogs with captured auth * fix(llama-cpp): expose catalog auth before runtime activation * chore: remove stale doctor test line allowance * fix(agents): retain discovered facts for sparse configured models * test(agents): type sparse catalog fixtures at the runtime boundary * test(agents): use complete configured model fixtures * fix(llama-cpp): keep discovered facts on their verified route
#168309) * fix(llama-cpp): keep unverified router facts out of setup config * fix(models): admit deferred local catalogs with captured auth * fix(llama-cpp): expose catalog auth before runtime activation * chore: remove stale doctor test line allowance * fix(agents): retain discovered facts for sparse configured models * test(agents): type sparse catalog fixtures at the runtime boundary * test(agents): use complete configured model fixtures * fix(llama-cpp): keep discovered facts on their verified route (cherry picked from commit 8972b77)
Related: #139802
What Problem This Solves
Fixes oversized requests and stale tool capabilities when Existing llama-server setup discovers unloaded router models.
User Impact
Setup leaves unverified context/tool fields unset. After a model is loaded, refresh supplies its live
/propsfacts to the catalog and agent runtime. Explicit configured values remain authoritative. Background discovery still usesautoload=false; unknown runtime facts retain the existing 128,000-token/tools-disabled fallback.Older generated overrides cannot be distinguished from authored values. Remove the affected generated model row before refreshing or rerunning setup, as documented in the provider guide. Rerunning setup alone preserves existing overrides. No migration, new configuration, dependency, or automatic model loading is added.
Why This Change Was Made
The llama.cpp mapper separates setup persistence from runtime defaults, and provider refresh fills omitted fields. A single lightweight catalog entry exposes the existing discovery/auth policy before full plugin activation; full registration reuses it. This builds on the manifest-auth catalog repair in #168039.
Live testing also exposed a resolver gap: sparse configured rows discarded admitted registry facts except price, falling back to a 200K agent budget despite a refreshed 32K catalog. Resolution now inherits the current same-route catalog and preserves omitted context fields, while the existing owner retains transport and capability rules. Refresh also leaves model-specific endpoint/API overrides alone instead of copying facts from a different route.
Production: +167/-144 (net +23, including manifest); tests: +219/-3; docs: +20/-1. The small production increase covers the catalog entry/auth split and route-checked runtime inheritance; no duplicate discovery owner remains.
Evidence
--models-max 1, Qwen3-1.7B and Qwen3-0.6B Q8_0, bothctx-size=32768: actual noninteractive Existing llama-server onboarding formerly persisted 128000/false for unloaded B; repaired onboarding omits those fields. After explicitly warming B, CLI and Gatewaymodels list --provider llama-cpp --refresh --jsonreport 32768/32768 without saving overrides.agent --model llama-cpp/qwen3-0.6b --message-file long-1.txt --thinking off --json) returnedACK1.in 21.11s with 26,128 prompt tokens and a resolved 32,768-token budget, with no context override in config. The second large turn is refused locally in 10.99s against that same limit; before repair it sent 45,398 tokens to the 32K server and received HTTP 400. Compaction cannot retain a complete recent message beside this oversized new prompt, so a smaller request/new session is still required.pnpm buildpassed (474.32s wall). Build emitted an unrelated UI gzip-budget warning (365.3 KiB versus 364.7 KiB); no UI files changed. Codex autoreview is scoped-clean at P0–P2 after fixing its cross-route finding. ClawSweeper reviewed this exact head with no code findings. Its sole latest-stable saved-config upgrade-proof hold is maintainer-overridden under the campaign instruction; that upgrade cell was not run.Main integration and complete CI
Merged
origin/mainat0aee279a71af78b8914dced0507ddb94c0d1f5b0, includingdb6449d3f609and #167814, without conflicts or changes to this lane's source/test files. Pushed once atc490a35fe6deab8d10df95ab8f46f4e5b1f95327withci:no-fail-fastapplied. The earlier live proof and scoped-clean autoreview cover the unchanged repair.The integrated tree passed all 152 focused tests (11 files, 295.65s wall), touched-file formatting and typed lint, and all required ratchets. CI run 38044975304 completed successfully: 40 jobs passed, 25 conditionally skipped, zero failures or cancellations. Both UI e2e shards and
openclaw/ci-gatepassed. Logs confirm all eight session-dashboard cases ran, including both previously failing pin cases; the guest-publication suite was not selected. This run does not establish that the inherited UI defect is fixed.ClawSweeper reviewed the integrated head at 2026-10-10T10:34:46Z and found no code defects. Its sole saved-config upgrade-proof hold is covered by the lead’s explicit proof-only override; that upgrade cell was not run.