Repository navigation
fix(llama-cpp): existing-server setup chooses ready models first - #129509
Merged
Merged
Conversation
Contributor
|
🦞👀 Pull request received. I will update this pull request when review starts. |
steipete
marked this pull request as ready for review
August 25, 2026 18:01
Contributor
Author
|
Merged via squash.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What Problem This Solves
Fixes an issue where users connecting OpenClaw to an existing llama.cpp router could have guided, interactive, or non-interactive setup select an unloaded model even though a healthy model was already loaded or sleeping. A higher-ranked but unloaded model family could trigger an avoidable cold load, probe timeout, or setup failure.
Why This Change Was Made
The llama.cpp provider owner sorted ready models first but then passed every model to global family ranking, which discarded that readiness ordering. Select the healthy loaded-or-sleeping tier first, then apply the existing family preference only within that tier; when no models are ready, preserve the existing healthy-catalog fallback. The shared owner covers all three setup flows without changing explicit model choices or other providers. Production code decreases by two lines.
User Impact
Existing llama.cpp server setup now consistently prefers an already-available healthy model instead of unexpectedly choosing an unloaded higher-ranked family. Existing family ordering, failed-model exclusion, empty catalogs, and explicit requested model selection retain their current behavior.
Evidence
/health,/models, and/props?model=...&autoload=false; before the fix both ready states selected the unloaded model, and after the fix both selected the loaded or sleeping model without changing the external server.OPENCLAW_VITEST_MAX_WORKERS=1 OPENCLAW_VITEST_FS_MODULE_CACHE_PATH=/private/tmp/openclaw-vitest-r3-qa-setup node scripts/run-vitest.mjs extensions/llama-cpp/src/external-server/setup.test.ts extensions/llama-cpp/src/external-server/discovery.test.ts extensions/llama-cpp/src/external-server/models.test.ts extensions/llama-cpp/src/external-server/endpoint.test.ts extensions/llama-cpp/src/external-server/auth.test.ts extensions/lmstudio/src/setup.test.ts extensions/ollama/src/setup-model-selection.test.ts --configLoader runner— 106 tests passed across seven files and two Vitest projects.node_modules/.bin/oxfmt --check extensions/llama-cpp/src/external-server/setup.ts extensions/llama-cpp/src/external-server/setup.test.tsnode_modules/.bin/oxlint --config .oxlintrc.json extensions/llama-cpp/src/external-server/setup.ts extensions/llama-cpp/src/external-server/setup.test.ts