Repository navigation
Conversation
- Fetch models from OpenAI-compatible providers with baseURL in config - Support plugin-registered discovery loaders (e.g., GitLab) - Discovery runs synchronously during bootstrap init - Remove providers with no models after successful discovery - Add tests for discovery and model registration
- Extract discoverProviderModels() helper from inline 110-line Effect.gen - Replace globalThis.fetch with HttpClient layer (FetchHttpClient) - Add Effect.timeout(10s) to HTTP discovery requests - Replace Exit._tag with Exit.isSuccess/IsFailure - Remove redundant config.get() in init() (use captured s.cfg) - Remove unnecessary 'as any' casts - Fix indentation to consistent 2-space - Set family: 'discovered' on discovered models - Update discovery tests to use HttpClient layer mocks
… exceeding discovered
…nai-compatible schemas - Log warning and continue when provider disappears between discovery snapshot and apply - Add @ai-sdk/openai-compatible to schema sanitization check - Add test case for openai-compatible schema sanitization
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.
Issue for this PR
Type of change
What does this PR do?
Auto-discovers available models from OpenAI-compatible providers that have a
baseURLconfigured inopencode.json. Instead of requiring users to list every model manually, opencode now callsGET /v1/modelsat startup and populates the model list.Models come from three sources: Models.dev (metadata), config file (overrides), and the provider API (actual availability). A model is visible only if the provider API returns it or it is declared in config. Metadata is merged with API > config > Models.dev precedence.
This means providers like LM Studio, Ollama, and self-hosted OpenAI-compatible servers automatically show their loaded models without any per-model configuration.
How did you verify your code works?
baseURL/modelslist without manual per-model configbun typecheckfrompackages/opencode— passesChecklist