[PR #10116] feat(opencode): add config options to enable or disable models per provider #13341

Open
opened 2026-02-16 18:18:12 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/10116

State: open
Merged: No


What does this PR do?

Closes #9203

This adds both a disabled_models and a enabled_models option to help give better control over which models are shown. Supports both full IDs as well as glob patterns. These options mirror how the enabled_providers and disabled_providers options set precedence.

This is useful in situations like Enterprises where only certain models are allowed for use, even though a provider may expose more. For example, this can allow for disabling preview models. Or to only allow OpenAI codex models for a cleaner view.

How did you verify your code works?

I verified that all tests passed and also verified the functionality locally. Used the following config options to try it out locally with bun dev:

  "enabled_models": {
    "openai": ["gpt-5.2-codex"],
    "opencode": ["claude-sonnet-4-5"]
  },
  "disabled_models": {
    "google": ["gemini-1*"]
  }

And that gave me the following result with my setup:

image
**Original Pull Request:** https://github.com/anomalyco/opencode/pull/10116 **State:** open **Merged:** No --- ### What does this PR do? Closes #9203 This adds both a `disabled_models` and a `enabled_models` option to help give better control over which models are shown. Supports both full IDs as well as glob patterns. These options mirror how the `enabled_providers` and `disabled_providers` options set precedence. This is useful in situations like Enterprises where only certain models are allowed for use, even though a provider may expose more. For example, this can allow for disabling `preview` models. Or to only allow OpenAI codex models for a cleaner view. ### How did you verify your code works? I verified that all tests passed and also verified the functionality locally. Used the following config options to try it out locally with `bun dev`: ``` "enabled_models": { "openai": ["gpt-5.2-codex"], "opencode": ["claude-sonnet-4-5"] }, "disabled_models": { "google": ["gemini-1*"] } ``` And that gave me the following result with my setup: <img width="854" height="698" alt="image" src="https://github.com/user-attachments/assets/a34ab951-9546-4175-9762-99eb372ddcdb" />
yindo added the pull-request label 2026-02-16 18:18:12 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#13341