Skip to content

refactor(lmstudio): unify catalog discovery provider assembly - #130204

Merged
steipete merged 1 commit into
mainfrom
codex/lmstudio-discovery-refactor-r8
Aug 26, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/lmstudio-discovery-refactor-r8

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

LM Studio catalog discovery maintained separate provider-construction and credential-resolution error paths for explicitly configured models and live-discovered models. Keeping those paths aligned made a stable, security-sensitive provider boundary harder to maintain.

Why This Change Was Made

Consolidate ordered provider-header and configured-key resolution into its existing fail-closed error boundary, then select either the explicit provider or live catalog before using one provider/auth materialization path. Explicit models still bypass network discovery and retain their original model array, explicit-only API default, property ordering, and normalized URL. Discovered providers retain their existing field precedence, empty-catalog behavior, quiet mode, Authorization-header precedence, SecretRef handling, and authentication-marker semantics.

This is an owner-local refactor of extensions/lmstudio/src/setup.ts: 20 production lines added, 42 removed, net -22. No test, public API, configuration, storage, or security-policy changes.

User Impact

No user-visible behavior changes. Existing installed LM Studio configurations, credentials, configured models, and automatic discovery continue to work identically.

Evidence

  • Unchanged existing LM Studio discovery/setup owner suite: 47/47 passed on the unmodified baseline, then passed again after the refactor.
  • Complete LM Studio plugin suite: 211/211 tests passed across all 10 files, including explicit-model/no-network, unresolved SecretRef, Authorization-header, discovery-key precedence, synthetic-auth, and empty-catalog coverage.
  • Canonical repository lint wrapper with full --type-aware --type-check and the extensions tsconfig: clean, zero diagnostics. Documented OPENCLAW_OXLINT_SKIP_PREPARE=1 skipped only unrelated global SDK-artifact preparation; all type-aware policy remained enabled.
  • Scoped formatter: clean. Two independent source reviews and the required automated review: no actionable findings.
  • Read-only verification against the existing local LM Studio models endpoint: 14 installed models, 0 loaded models, 1 embedding model; no service or model state was changed.

@clawsweeper

clawsweeper Bot commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

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

@steipete
steipete marked this pull request as ready for review August 26, 2026 15:47
@steipete
steipete marked this pull request as draft August 26, 2026 16:02
@steipete
steipete marked this pull request as ready for review August 26, 2026 16:02
@steipete
steipete merged commit bb0c204 into main Aug 26, 2026
228 of 267 checks passed
@steipete
steipete deleted the codex/lmstudio-discovery-refactor-r8 branch August 26, 2026 16:24
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant