Skip to content

provider.<id> whitelist/blacklist has no effect on the model picker (confirmed for both built-in opencode and openrouter providers) #61110

Open

Description

@maksym6866

Description

The whitelist (and blacklist) option under provider.<id> in opencode.json has no effect when applied to the built-in opencode zen provider (the free-tier account-linked provider). The model picker continues to show every model from the provider (including paid ones requiring a separate API key) instead of being filtered to the whitelisted set.

The same config works as documented when I tested the equivalent whitelist/blacklist syntax's schema shape (confirmed via https://opencode.ai/config.json), so this looks specific to the opencode provider, not a general config-parsing issue.

Steps to reproduce

  1. Log in with opencode auth login opencode.
  2. Add to opencode.json:
    {
      "provider": {
        "opencode": {
          "whitelist": ["flint-40b-free", "beam-free", "big-pickle"]
        }
      }
    }
  3. Restart the background service (opencode service restart) and reopen the TUI.
  4. Open the model picker (/models or the model selector).

Expected

Only the whitelisted models (Flint 40B Free, Beam Free, Big Pickle) appear under "Personal / OpenCode".

Actual

All models from the opencode provider still appear, both free and paid (e.g. Claude Sonnet 5.5, GPT-6 Luna, Grok 4.7, etc. all still show up unfiltered).

Environment

  • opencode v2.2.5
  • macOS (Apple Silicon, M2 Pro)

Activity

  1. opencodejr commented on Nov 1, 2026

    @opencodejr
    Contributor

    Thanks for the clear report! I think this is a duplicate of #49986.

    In v2, whitelist and blacklist under a provider aren't applied for any provider, not only opencode. They're dropped while the config is loaded, and the logs show an omitted unsupported legacy setting warning for $.provider.opencode.whitelist. The provider docs still describe these options, which is why the config looks like it should work.

    Related issues, most likely first:

    For now, you can hide specific models one at a time:

    {
      "providers": {
        "opencode": {
          "models": {
            "<model-id>": { "disabled": true }
          }
        }
      }
    }

    There's also a community plugin linked in #49986 that brings back the whitelist/blacklist filtering.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Feel free to add your use case to #49986.

  2. maksym6866 commented on Nov 2, 2026

    @maksym6866
    Author

    Confirmed this is not specific to the built-in opencode provider — it also affects a standard models.dev-backed provider like openrouter.

    Steps to reproduce (openrouter)

    1. Log in with opencode auth login openrouter.
    2. Add to opencode.json:
      {
        "provider": {
          "openrouter": {
            "whitelist": ["nemotron-3-ultra-550b-a55b:free", "nemotron-3.5-super-vl:free", "nemotron-3.5-lightning:free"],
            "models": {
              "nvidia/nemotron-3-ultra-550b-a55b:free": { "name": "Nemotron 3 Ultra (free)" },
              "nvidia/nemotron-3.5-super-vl:free": { "name": "Nemotron 3.5 Super VL (free)" },
              "nvidia/nemotron-3.5-lightning:free": { "name": "Nemotron 3.5 Lightning (free)" }
            }
          }
        }
      }
    3. Restart the background service (opencode service restart).
    4. Run opencode models or open the model picker.

    Expected

    Only the 3 whitelisted OpenRouter models appear.

    Actual

    opencode models lists the entire OpenRouter catalog (300+ models), unfiltered — the whitelist has no effect. The models themselves work fine when invoked directly by ID (opencode run -m openrouter/nvidia/nemotron-3.5-lightning:free "..." responds correctly), so this is purely a model-listing/filtering bug, not an auth or routing issue.

    This suggests whitelist/blacklist is broken for provider config in general, not just the account-linked opencode provider. Updating the title to reflect the broader scope would help others find this.

    Environment

    • opencode v2.2.5
    • macOS (Apple Silicon, M2 Pro)
  3. changed the title [-]provider.opencode whitelist/blacklist has no effect on the built-in opencode (zen) provider's model picker[/-] [+]provider.<id> whitelist/blacklist has no effect on the model picker (confirmed for both built-in opencode and openrouter providers)[/+] on Nov 2, 2026
  4. opencodejr commented on Nov 2, 2026

    @opencodejr
    Contributor

    Closing this as a duplicate of #49986, since there hasn't been a reply saying how it's different. In v2, per-provider whitelist/blacklist are dropped while the config is loaded, for every provider including opencode. #49986 tracks a native v2 replacement, and #54372 is an open PR that would make these options work again.

    In the meantime, you can hide individual models with providers.opencode.models.<model-id>.disabled: true, or use the community plugin linked in #49986. Please follow #49986 for updates. If your problem turns out to be different, reply here and we'll take another look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions