Description
When using a custom provider configured with "@ai-sdk/openai-compatible" and a baseURL, models that are both manually listed in opencode.json and auto-discovered from the provider's /v1/models endpoint appear as duplicate entries in the model selector. The same model ID shows twice within the same provider section: once with the configured name (from opencode.json) and once with the raw API-discovered tag.
For example, if I manually configure:
"models": {
"deepseek-v3.2:cloud": { "name": "DeepSeek V3.2" }
}
The model selector shows both "DeepSeek V3.2" AND "deepseek-v3.2:cloud" as separate entries. This makes the list noisy and confusing.
Plugins
None — using core @ai-sdk/openai-compatible provider.
OpenCode version
1.3.x
Steps to reproduce
- Configure a provider in opencode.json using npm: "@ai-sdk/openai-compatible" with a baseURL (e.g., https://ollama.com/v1)
- Manually define one or more models in the provider's "models" object with custom "name" fields
- Launch opencode and open the model selector (/model)
- Observe each manually configured model appears twice: once with the custom name, once with the raw API tag
Expected behavior
Auto-discovered models from the same provider should merge with (or override) manually-configured entries when the model ID matches, avoiding duplicates within the same provider.
Actual behavior
Both the manual entry and the auto-discovered entry appear side-by-side in the model list.
Workaround
Remove manual models entries from the provider config and accept raw API names + default context limits.
Related issues
Description
When using a custom provider configured with "@ai-sdk/openai-compatible" and a baseURL, models that are both manually listed in opencode.json and auto-discovered from the provider's /v1/models endpoint appear as duplicate entries in the model selector. The same model ID shows twice within the same provider section: once with the configured name (from opencode.json) and once with the raw API-discovered tag.
For example, if I manually configure:
The model selector shows both "DeepSeek V3.2" AND "deepseek-v3.2:cloud" as separate entries. This makes the list noisy and confusing.
Plugins
None — using core @ai-sdk/openai-compatible provider.
OpenCode version
1.3.x
Steps to reproduce
Expected behavior
Auto-discovered models from the same provider should merge with (or override) manually-configured entries when the model ID matches, avoiding duplicates within the same provider.
Actual behavior
Both the manual entry and the auto-discovered entry appear side-by-side in the model list.
Workaround
Remove manual models entries from the provider config and accept raw API names + default context limits.
Related issues