fix(app): fetch live LM Studio models instead of static catalog

SM
5mo ago
+381-0

Summary

Connecting LM Studio surfaced three hardcoded models from the models.dev catalog (gpt-oss-20b, qwen3-30b, qwen3-coder-30b) regardless of what the user actually had downloaded.

This mirrors the existing Ollama integration so LM Studio gets a dedicated settings panel that queries the running local server (http://127.0.0.1:1234) and lists the user's real models.

Changes

  • lmstudio-config.tsx — settings panel fetching /api/v0/models (rich metadata: type, state, context length), falling back to the OpenAI-compatible /v1/models endpoint on older builds
  • LMSTUDIO_PROVIDER_CONFIG constant in openai-image-extension.ts
  • registered the panel as a built-in extension in extensions.ts (settings-panel + provider-connected enablement)
  • side-effect import wired in settings-route.tsx
  • ext-lmstudio.svg icon

The selected live model is written into opencode.jsonc via the existing generic installLocalProvider flow.

Root cause

Ollama is absent from the models.dev catalog, so OpenWork already ships a live-fetch panel for it. LM Studio is in the catalog with static models and had no equivalent panel — so the catalog's fixed list was shown instead of the running server's models.

Testing

  • Verified the new panel mirrors the known-good ollama-config.tsx structure/imports
  • No tests assert on the built-in extension list