Skip to content

fix(lmstudio): report model discovery failures - #139849

Merged
obviyus merged 1 commit into
mainfrom
codex/lmstudio-catalog
Sep 6, 2026
Merged

obviyus merged 1 commit into
mainfrom
codex/lmstudio-catalog

Conversation

@obviyus

@obviyus obviyus commented Sep 6, 2026 •

Copy link
Copy Markdown
Collaborator

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.

@obviyus obviyus self-assigned this Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation extensions: lmstudio size: M maintainer Maintainer-authored PR labels Sep 6, 2026
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 6, 2026
@clawsweeper

clawsweeper Bot commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 6, 2026, 2:34 AM ET / 06:34 UTC.

ClawSweeper review

What this changes

The 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
Reviewed head: d6d441ae1dd89729bd954d37d2f4fe02ca7c06ac

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused producer repair with meaningful regression coverage, preserved public defaults, and no blocking finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The repository-state snapshot identifies a MEMBER-authored PR, so the ordinary contributor proof gate is exempt; the body reports built-Gateway HTTP fault, recovery, empty-inventory, and credential-change observations for the changed catalog path.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The repository-state snapshot identifies a MEMBER-authored PR, so the ordinary contributor proof gate is exempt; the body reports built-Gateway HTTP fault, recovery, empty-inventory, and credential-change observations for the changed catalog path.
Evidence reviewed 8 items Pinned introduction and current-main necessity: The complete introduced delta contains only the five supplied LM Studio paths. Comparing fetched main with the merge base showed no LM Studio differences; current main's registered hook still calls the advisory helper without strict acquisition.
Producer repair and preserved call contract: The one-argument overload retains provider-or-null advisory behavior. Registered discovery opts into the existing outcome wrapper; explicit models bypass acquisition, excluded provider contexts return early, and header authentication does not acquire an unused profile identity.
Existing shared publication contract: The existing publisher retains failed-provider inventory only when credential and profile facts remain compatible, while ready empty results bypass retention. The SDK documentation already prescribes strict bundled discovery and advisory public defaults.
Findings None None.
Security None None.

How this fits together

The 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]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Source +4, Tests +109, Docs +8. Total +121 across 5 files.

View PR surface stats
Area Files Added Removed Net
Source 3 83 79 +4
Tests 1 110 1 +109
Docs 1 8 0 +8
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 5 201 80 +121

Review metrics

None.

Technical review

Best 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.

Labels

Label changes:

  • add P2: This repairs misleading discovery outcomes for one provider without evidence of an urgent core-runtime regression.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository-state snapshot identifies a MEMBER-authored PR, so the ordinary contributor proof gate is exempt; the body reports built-Gateway HTTP fault, recovery, empty-inventory, and credential-change observations for the changed catalog path.

Label justifications:

  • P2: This repairs misleading discovery outcomes for one provider without evidence of an urgent core-runtime regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: The repository-state snapshot identifies a MEMBER-authored PR, so the ordinary contributor proof gate is exempt; the body reports built-Gateway HTTP fault, recovery, empty-inventory, and credential-change observations for the changed catalog path.

Evidence

What I checked:

  • Pinned introduction and current-main necessity: The complete introduced delta contains only the five supplied LM Studio paths. Comparing fetched main with the merge base showed no LM Studio differences; current main's registered hook still calls the advisory helper without strict acquisition. (extensions/lmstudio/index.ts:117, 56e96f6921b8)
  • Producer repair and preserved call contract: The one-argument overload retains provider-or-null advisory behavior. Registered discovery opts into the existing outcome wrapper; explicit models bypass acquisition, excluded provider contexts return early, and header authentication does not acquire an unused profile identity. (extensions/lmstudio/src/setup.ts:939, d6d441ae1dd8)
  • Existing shared publication contract: The existing publisher retains failed-provider inventory only when credential and profile facts remain compatible, while ready empty results bypass retention. The SDK documentation already prescribes strict bundled discovery and advisory public defaults. (src/agents/prepared-model-runtime.full-catalog.ts:113, d6d441ae1dd8)
  • Security and authentication scope: The shared wrapper emits secret-free catalog-scoped rejection outcomes. The Gateway explicitly excludes catalog-scoped rejection from inference-auth rejection, and the patch leaves request credential selection and transport protections intact. (src/gateway/server-methods/models-list-auth-resolver.ts:134, d6d441ae1dd8)
  • Shipped helper compatibility: The v2026.9.2 API exports discoverLmstudioProvider, whose shipped one-argument implementation returns provider-or-null and suppresses discovery failures. The proposed overload preserves that contract rather than replacing it. (extensions/lmstudio/src/setup.ts:953, 3928bad9badf)
  • Regression coverage and reported runtime observations: The added tests exercise registered acquisition for HTTP 401/403/503, disconnect, invalid JSON, missing models, header attribution, keyless empty results, and provider filtering. The captured PR body separately reports built-Gateway HTTP fault/recovery observations at this head and stable-package compatibility checks. Those runtime runs were not independently executed during this read-only review. (extensions/lmstudio/src/models.fetch.test.ts:28, d6d441ae1dd8)

Likely related people:

  • obviyus: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)
  • Peter Steinberger: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@obviyus
obviyus merged commit eba0d71 into main Sep 6, 2026
151 checks passed
@obviyus
obviyus deleted the codex/lmstudio-catalog branch September 6, 2026 06:39
@obviyus

obviyus commented Sep 6, 2026

Copy link
Copy Markdown
Collaborator Author

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.

  • Bug: Configured model-list failures looked like empty inventory without a failure outcome.
  • Fix: The LM Studio producer reports typed acquisition outcomes to the existing catalog publisher while preserving advisory helper defaults.
Before After
Configured HTTP 503 returned an empty list with no failure outcome. Reports unavailable; retains only compatible prior inventory.
Successful empty and failed discovery were indistinguishable. Successful empty clears discovered rows; recovery publishes new rows.

Production +4 lines, tests +109, docs +8; generated/lockfile unchanged. The broader staging draft #136257 remains separate.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 7, 2026
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation extensions: lmstudio maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant