Skip to content

Auto-discovered models duplicate manually-configured entries within same provider #27655

@cristoslc

Description

@cristoslc

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

  1. Configure a provider in opencode.json using npm: "@ai-sdk/openai-compatible" with a baseURL (e.g., https://ollama.com/v1)
  2. Manually define one or more models in the provider's "models" object with custom "name" fields
  3. Launch opencode and open the model selector (/model)
  4. 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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions