Repository navigation
fix(llama-cpp): report external server model discovery failures - #139846
Merged
Merged
Conversation
Contributor
|
🦞👀 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. |
obviyus
marked this pull request as ready for review
September 6, 2026 06:27
Collaborator
Author
|
Verified head: Exact-head CI is green: run 34016534632. The retained watcher ended
|
Collaborator
Author
|
Landed in 0ed5f76cbea5cc43734ff201e6c61102eb2f0e58.
|
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
Sep 7, 2026
…claw#139846) ## What Problem This Solves Fixes an issue where refreshing models from a configured external llama-server silently returned an empty or cached model list when the server rejected authentication or discovery failed. Related: openclaw#136257. This extracts the external llama-server producer repair; the source draft stays open and unmerged. ## Why This Change Was Made The external producer converted structured discovery failures into successful provider results. It now uses the existing live-catalog outcome handler and bypasses the advisory discovery cache on explicit refresh. The shared publication owner can retain compatible inventory, expose the failure, and replace it on recovery. The provider preserves explicit Authorization precedence and attributes an outcome only to the profile whose actual credential supplied discovery. Synthetic local markers do not turn unconfigured probes into failures. The canonical provider builder already normalizes the endpoint, so redundant reconstruction and the success-shaped failure branch are removed. ## User Impact - HTTP 401/403 reports authentication rejection; service, transport and malformed-response failures report unavailability. - Compatible inventory survives temporary failure; replacing the endpoint or credentials cannot retain the prior scope's discovered rows. - A successful empty catalog removes discovered rows while preserving explicit models. - Managed llama.cpp, dynamic model preparation, and the published advisory helper defaults stay unchanged. ## Evidence - Built baseline `d103ceca3aaab116245989553ae776e621b462ec`: Gateway `models.list` returned `models: []` with no outcome during a captured `/models` HTTP 503. A healthy control returned `catalog-one`; the following 401 refresh still had no failure outcome. - Built candidate `7d76f5eccc52801ebcd61cbc729ab2649517c39a`: the same cold-failure flow returns `providerOutcomes: [{ provider: "llama-cpp", status: "unavailable" }]`. The existing shared static starter remains distinguishable from live discovery by this provider outcome. - Seven changed regressions fail on the baseline. Candidate producer tests pass 15/15; retained sibling coverage passes 87/87 and doctor contracts pass 5/5. Syntax lint checks both changed TypeScript files with no diagnostics; format and assertion/line ratchets pass. - Independent code review is clean through P2. Exact builds use isolated Node 24 containers and synthetic HTTP faults through the normal Gateway/CLI; no operator state or live inference account is used. - Independent runtime acceptance covers immediate refresh, six failure inputs, retained inventory and recovery, endpoint/key/header/profile-secret replacement, authoritative empty/manual rows, actual profile attribution, header precedence, quiet unconfigured reads, and the public advisory helper. Direct curl distinguishes HTTP 503 from an empty-response transport failure; the Gateway reports `unavailable` for both. The public outcome schema intentionally omits the internal rejection scope, and catalog-only rejection leaves explicit execution routes available. - Stable `@openclaw/[email protected]` exposes the plugin entry and embedding policy helper, not this private producer. The published `provider-setup` advisory discovery default and its existing `rawResult` selector are unchanged. The owning manifest already declares refreshable discovery. - The outcome helper comes from the merged shared catalog prerequisite. Normal release synchronization advances plugin API compatibility and the published host peer range; this PR does not publish a standalone plugin for the old host. - Scope: production +10 lines, tests/support +37, docs +6; no generated, dependency, configuration or schema changes. The small production increase supplies typed outcomes and credential attribution after removing duplicated provider construction; broader transport or managed-path cleanup would be unrelated. Known pre-existing follow-up: shared discovery selects synthetic no-auth when only a stored llama.cpp profile is configured and the provider key is unset. This PR leaves shared credential selection unchanged. Positive profile attribution and replacement were exercised through the supported `LLAMA_SERVER_API_KEY` placeholder route with no environment value. Managed/native execution is covered by unchanged owner paths and tests, not live inference. Co-authored-by: Ayaan Zaidi <[email protected]>
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.
Related: #136257.
What Problem This Solves
Refreshing an external model server could silently return empty or cached inventory after authentication rejection or discovery failure.
Why This Change Was Made
The external producer uses the shared catalog-outcome handler and bypasses the advisory discovery cache on explicit refresh. It preserves explicit authorization-header precedence and attributes outcomes only to the credential profile actually used. Redundant provider reconstruction and success-shaped failures are removed.
User Impact
Authentication rejection and unavailability remain visible while compatible inventory survives temporary failure. Endpoint or credential replacement retires old learned rows. Successful empty results remove discovery rows but preserve explicit models. Managed-server behavior and public advisory defaults remain unchanged.
Consumers: external-server refresh now publishes actual acquisition outcomes.
Evidence
The built baseline hid failures; the candidate reported them. Seven regressions failed before repair. Candidate tests passed 15 producer, 87 sibling, and five Doctor cases. Built Gateway/CLI checks covered failures, recovery, empty results, credential changes, headers, attribution, and helper compatibility against synthetic endpoints. Shared discovery retains a separate stored-profile/no-provider-key selection limitation. No live inference was tested. The bundled helper requires normal host/plugin release synchronization.