Repository navigation
fix(lmstudio): report model discovery failures - #139849
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: needs maintainer review before merge. Reviewed September 6, 2026, 2:34 AM ET / 06:34 UTC. ClawSweeper reviewWhat this changesThe LM Studio plugin reports catalog acquisition failures separately from successful empty responses while preserving its public advisory helper, with regression coverage and troubleshooting guidance. Merge readiness✅ Ready for maintainer review This remains a useful, focused repair: current main still treats LM Studio discovery failures as empty results. No blocking defect was found, and the related staging PR does not supersede this implementation. Priority: P2 Review scores
Verification
How this fits togetherThe LM Studio plugin discovers models from a configured local server and supplies them to OpenClaw’s shared catalog publisher. Acquisition outcomes let that publisher distinguish a temporary failure from an authoritative empty inventory. flowchart TD
A[Server configuration and credentials] --> B[LM Studio catalog hook]
B --> C{Explicit models configured?}
C -->|Yes| F[Configured model inventory]
C -->|No| D[LM Studio HTTP discovery]
D --> E[Models or typed failure outcome]
E --> G[Shared catalog publication]
F --> G
G --> H[Model lists and pickers]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +4, Tests +109, Docs +8. Total +121 across 5 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep discovery failure reporting in the LM Studio producer and inventory retention in the shared publisher, preserving advisory callers and explicitly configured models. Do we have a high-confidence way to reproduce the issue? Yes, from source: a configured LM Studio endpoint returning HTTP 503 reaches the advisory empty-array path on current main without emitting a failure outcome; no runtime reproduction was executed in this review. Is this the best way to solve the issue? Yes. Reusing the documented shared acquisition wrapper repairs the producer boundary while preserving the shipped helper and avoiding a second retention implementation. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 56e96f6921b8. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Thanks @obviyus! Landed in eba0d71a1757 from reviewed head d6d441ae1dd8. Proof: 221 LM Studio tests pass; the built Gateway and synthetic native HTTP endpoint verify failure, retention, recovery, empty inventory, credential changes, and public-helper compatibility. Independent source-blind acceptance covers the same build, including actual CLI profile replacement and published provider filtering. Exact-head CI passed, and both landing and public ClawSweeper reviews reached platinum (4/6) with no findings.
Production +4 lines, tests +109, docs +8; generated/lockfile unchanged. The broader staging draft #136257 remains separate. |
Related: openclaw#136257 ## What Problem This Solves Fixes an issue where users refreshing LM Studio models would receive an empty catalog with no failure outcome when their configured server was unavailable, rejected authentication, or returned malformed data. ## Why This Change Was Made The registered LM Studio catalog now uses the shared typed acquisition outcomes. The existing publication owner can retain compatible last-good inventory during an outage, discard it after an endpoint or credential change, and clear it after a successful empty response. The producer reports the profile that supplied the actual request credential; explicit header authentication is not attributed to an unused profile. The published `discoverLmstudioProvider(ctx)` helper keeps its advisory default and provider-or-null return contract, verified against the actual 2026.9.2 package exports and bundle. Dynamic preparation and setup keep their existing behavior. A one-use catalog assembly helper is removed. ## User Impact - Configured failures report `unavailable` or catalog-scoped `auth-rejected` instead of looking like a successful empty inventory. - Recovery replaces retained rows; a successful empty response clears discovered rows. - Explicit manual models stay available without discovery, and unconfigured probes stay quiet. - Provider-context filtering skips excluded acquisition through the existing plugin API. ## Evidence - Built baseline `89aa37fb4c46`: configured HTTP 503 yielded `{ "models": [] }` with no failure outcome; eight new producer regressions failed before the repair. - Built candidate `d6d441ae1dd8`: 51 owner observations cover six failure cases, recovery, authoritative empty, endpoint/key/header changes, manual rows, helper compatibility, and loaded-model setup. - Independent source-blind acceptance retained 183 observations, including real CLI profile replacement without restart. A focused follow-up verified four filter exclusions and two positive acquisition controls after correcting an unsupported Gateway-filter assumption to the existing published provider-context contract; all required behavior is covered. - All 221 LM Studio tests pass. Syntax lint, formatting, assertion safety, conflict-marker, coercion, line-count and focused docs checks pass. Source review found no actionable P0–P2 issues. - Proof uses a built Gateway and real HTTP requests to an isolated synthetic native LM Studio endpoint. It does not claim actual LM Studio inference quality or a deployment test. - Production delta: +4 lines after removing the old assembly path; tests +109; docs +8; generated/lockfile 0. The small production increase preserves the shipped helper types/default while adding typed outcome and request-profile reporting. The Gateway `models.list` request has no provider-filter parameter; filtering is the existing provider-context API contract. Shared discovery's first-usable profile selection remains an unchanged follow-up; the credential replacement proof uses an actually selected profile. Co-authored-by: Ayaan Zaidi <[email protected]>
Related: #136257.
What Problem This Solves
Refreshing a configured local model server returned empty inventory without a failure outcome when the server was unavailable, rejected authentication, or sent malformed data.
Why This Change Was Made
The registered catalog reports typed acquisition outcomes to the existing publication owner. Request attribution names only the profile whose credential was used. The public discovery helper retains its advisory default and provider-or-null return contract; setup and dynamic preparation remain unchanged.
User Impact
Failures retain compatible last-good rows with an unavailable or authentication-rejected outcome. Endpoint or credential changes retire incompatible inventory. Successful empty results clear learned rows, while explicit models remain available. Unconfigured probes stay quiet.
Consumers: registered catalog discovery and failure display now distinguish unavailable service from successful empty inventory.
Evidence
The built baseline hid a service failure, and eight producer regressions failed before repair. Candidate checks covered failures, recovery, empty results, endpoint/key/header changes, manual rows, helper compatibility, and setup. Public command-line checks verified profile replacement without restart; provider-context tests verified exclusions. All 221 provider tests and focused checks passed. A Gateway used a synthetic endpoint; inference and deployment were not tested.