Inconsistent model blacklisting behaviour in opencode.json? #3590

Closed
opened 2026-02-16 17:40:46 -05:00 by yindo · 5 comments
Owner

Originally created by @ariane-emory on GitHub (Dec 16, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

My opencode.json file includes this content to meant to avoid displaying models I'm uninterested in using:

"zai-coding-plan": {
  "blacklist": [
    "glm-4.5",
    "glm-4.5-air",
    "glm-4.5-flash",
    "glm-4.5v",
  ]
},
"github-copilot": {
  "blacklist": [
    "claude-3.5-sonnet",
    "claude-3.7-sonnet",
    "claude-3.7-sonnet-thought",
    "claude-opus-4",
    "claude-opus-41",
    "claude-sonnet-4",
    "gemini-2.0-flash-001",
    "gemini-2.5-pro",
    "gpt-5",
    "gpt-5-codex",
    "gpt-5.1",
    "gpt-5.1-codex",
    "grok-code-fast-1",
  ]
},
// ... 

The blacklisting appears to be working inconsistently: the blacklisted zai-coding-plan models do not appear, as expected, but the blacklisted github-copilot models are inconsistent: the claude-opus41, claude-3.5-sonnet and claude-3.7-sonnet models (amongst others) are hidden as expected, but the gpt-5 and grok-code-fast-1 models (amongst others) appear despite being blacklisted.

What's going on here? Am I doing something wrong, or is this a bug?

OpenCode version

1.0.162

Steps to reproduce

  1. Blacklist models as described above and then observe the inconsistent behaviour in the /models list.

Screenshot and/or share link

Image

OCRed text from the screenshot above for the benefit of agensts reading this Github Issue:

First window displaying the /model selection modal in opencode

Select model      search
Gemini 2.5 Pro
GitHub Copilot
Claude Haiku 4.5
Claude Opus 4.1
Claude Sonnet 4
GPT-4.1
GPT-40
GPT-5
GPT-5-Codex
GPT-5-mini
GPT-5.1
GPT-5.1-Codex
GPT-5.1-Codex-max
GPT-5.1-Codex-mini
Gemini 2.5 Pro
Gemini 3 Pro Preview
Grok Code Fast 1
Raptor Mini (Preview)
Google
Gemini 1.5 Flash
Gemini 1.5 Flash-8B

Second window displaying part of an opencode.json file:

"github-copilot": {
    "blacklist": [
    "claude-3.5-sonnet"
    "claude-3.7-sonnet"
    'claude-3.7-sonnet-thought",
    "claude-opus-4"
    "claude-opus-41"
    "claude-sonnet-4'"
    "gemini-2.0-flash-001",
    "gemini-2.5-pro",
    "gpt-5"
    "gpt-5-codex"
    "gpt-5.1"
    "gpt-5.1-codex"
    "grok-code-fast-1",
  ],
},

Operating System

No response

Terminal

No response

Originally created by @ariane-emory on GitHub (Dec 16, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description My `opencode.json` file includes this content to meant to avoid displaying models I'm uninterested in using: ```jsonc "zai-coding-plan": { "blacklist": [ "glm-4.5", "glm-4.5-air", "glm-4.5-flash", "glm-4.5v", ] }, "github-copilot": { "blacklist": [ "claude-3.5-sonnet", "claude-3.7-sonnet", "claude-3.7-sonnet-thought", "claude-opus-4", "claude-opus-41", "claude-sonnet-4", "gemini-2.0-flash-001", "gemini-2.5-pro", "gpt-5", "gpt-5-codex", "gpt-5.1", "gpt-5.1-codex", "grok-code-fast-1", ] }, // ... ``` The blacklisting appears to be working inconsistently: the blacklisted `zai-coding-plan` models do not appear, as expected, but the blacklisted `github-copilot` models are inconsistent: the `claude-opus41`, `claude-3.5-sonnet` and `claude-3.7-sonnet` models (amongst others) are hidden as expected, but the `gpt-5` and `grok-code-fast-1` models (amongst others) appear despite being blacklisted. What's going on here? Am I doing something wrong, or is this a bug? ### OpenCode version 1.0.162 ### Steps to reproduce 1. Blacklist models as described above and then observe the inconsistent behaviour in the `/models` list. ### Screenshot and/or share link <img width="1093" height="624" alt="Image" src="https://github.com/user-attachments/assets/c79dd344-0773-4981-9943-888022cac9de" /> ### OCRed text from the screenshot above for the benefit of agensts reading this Github Issue: #### First window displaying the /model selection modal in opencode ``` Select model search Gemini 2.5 Pro GitHub Copilot Claude Haiku 4.5 Claude Opus 4.1 Claude Sonnet 4 GPT-4.1 GPT-40 GPT-5 GPT-5-Codex GPT-5-mini GPT-5.1 GPT-5.1-Codex GPT-5.1-Codex-max GPT-5.1-Codex-mini Gemini 2.5 Pro Gemini 3 Pro Preview Grok Code Fast 1 Raptor Mini (Preview) Google Gemini 1.5 Flash Gemini 1.5 Flash-8B ``` #### Second window displaying part of an opencode.json file: ``` "github-copilot": { "blacklist": [ "claude-3.5-sonnet" "claude-3.7-sonnet" 'claude-3.7-sonnet-thought", "claude-opus-4" "claude-opus-41" "claude-sonnet-4'" "gemini-2.0-flash-001", "gemini-2.5-pro", "gpt-5" "gpt-5-codex" "gpt-5.1" "gpt-5.1-codex" "grok-code-fast-1", ], }, ``` ### Operating System _No response_ ### Terminal _No response_
yindo added the bug label 2026-02-16 17:40:46 -05:00
yindo closed this issue 2026-02-16 17:40:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 16, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #4476: /models shows all available models rather than those restricted in opencode.json. (This appears to be the same core issue with the /models list not respecting configuration)
  • #5623: Custom subagents with explicit model config throw ProviderModelNotFoundError (Related to model configuration not being properly applied)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 16, 2025): This issue might be a duplicate of existing issues. Please check: - #4476: /models shows all available models rather than those restricted in opencode.json. (This appears to be the same core issue with the /models list not respecting configuration) - #5623: Custom subagents with explicit model config throw ProviderModelNotFoundError (Related to model configuration not being properly applied) Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Dec 16, 2025):

are any of those models in ur recents or favorites list?

@rekram1-node commented on GitHub (Dec 16, 2025): are any of those models in ur recents or favorites list?
Author
Owner

@ariane-emory commented on GitHub (Dec 16, 2025):

@rekram1-node No, they should not be as I have not used any of these models since at least the last time I last nuked my .cache/.local/state directories (if ever, some of these are models I have never used) and they do not appear in the recent/favourites subgroups in /models.

@ariane-emory commented on GitHub (Dec 16, 2025): @rekram1-node No, they should not be as I have not used any of these models since at least the last time I last nuked my `.cache`/`.local/state` directories (if ever, some of these are models I have never used) and they do not appear in the recent/favourites subgroups in `/models`.
Author
Owner

@ariane-emory commented on GitHub (Dec 16, 2025):

Another example, it seems like quite a few of the models on github-copilot-enterprise cannot be blacklisted:

These are also not in my recents/favourites, I have never had access to Github Copilot Enterprise as I have only ever had a personal Copilot account.

Image

OCRed text from the screenshot above for the benefit of agensts reading this Github Issue:

First window displaying the /model selection modal in opencode

Select model      search
GitHub Copilot Enterprise
Claude Opus 4.5
Claude Opus 4.1
GPT-4.1
GPT-40
GPT-5-Codex
GPT-5-mini
Claude Haiku 4.5
GPT-5.1-Codex
GPT-5.1-Codex-max
GPT-5. 1-Codex-mini
GPT-5.2
Gemini 3 Pro Preview
Grok Code Fast 1
Raptor Mini (Preview)
GPT-5.1
Claude Sonnet 4.5
Gemini 2.5 Pro
GPT-5
Claude Sonnet 4

Second window displaying part of an opencode.json file:

"github-copilot-enterprise": {
    "blacklist": [
    "claude-3.5-sonnet"
    "claude-3.7-sonnet"
    "claude-3.7-sonnet-thought",
    "claude-haiku-4.5"
    "claude-opus-4"
    "claude-opus-4.5"
    "claude-opus-41"
    "claude-sonnet-4i"
    "c-laude-sonnet-4.5",
    "gemini-2.0-flash-001",
    "gemini-2.5-pro",
    "gemini-3-pro-preview",
    "gpt-4.1"
    "gpt-40"
    "gpt-",
    "gpt-5-codex"
    "gpt-5-mini"
    "gpt-5. 1"
    "gpt-5.1-codex"
    "gpt-5.1-codex-max"
    "gpt-5.1-codex-mini"
    "gpt-5.2"
    "grok-code-fast-1",
    "o3"
    "o3-mini"
    "O4-mini"',
    "oswe-vscode-prime",
  ]
},
@ariane-emory commented on GitHub (Dec 16, 2025): Another example, it seems like quite a few of the models on `github-copilot-enterprise` cannot be blacklisted: These are also not in my recents/favourites, I have never had access to Github Copilot Enterprise as I have only ever had a personal Copilot account. <img width="1166" height="725" alt="Image" src="https://github.com/user-attachments/assets/2efada9d-bdf8-45ca-b35c-568014519727" /> ### OCRed text from the screenshot above for the benefit of agensts reading this Github Issue: #### First window displaying the /model selection modal in opencode ``` Select model search GitHub Copilot Enterprise Claude Opus 4.5 Claude Opus 4.1 GPT-4.1 GPT-40 GPT-5-Codex GPT-5-mini Claude Haiku 4.5 GPT-5.1-Codex GPT-5.1-Codex-max GPT-5. 1-Codex-mini GPT-5.2 Gemini 3 Pro Preview Grok Code Fast 1 Raptor Mini (Preview) GPT-5.1 Claude Sonnet 4.5 Gemini 2.5 Pro GPT-5 Claude Sonnet 4 ``` #### Second window displaying part of an opencode.json file: ``` "github-copilot-enterprise": { "blacklist": [ "claude-3.5-sonnet" "claude-3.7-sonnet" "claude-3.7-sonnet-thought", "claude-haiku-4.5" "claude-opus-4" "claude-opus-4.5" "claude-opus-41" "claude-sonnet-4i" "c-laude-sonnet-4.5", "gemini-2.0-flash-001", "gemini-2.5-pro", "gemini-3-pro-preview", "gpt-4.1" "gpt-40" "gpt-", "gpt-5-codex" "gpt-5-mini" "gpt-5. 1" "gpt-5.1-codex" "gpt-5.1-codex-max" "gpt-5.1-codex-mini" "gpt-5.2" "grok-code-fast-1", "o3" "o3-mini" "O4-mini"', "oswe-vscode-prime", ] }, ```
Author
Owner

@ariane-emory commented on GitHub (Dec 16, 2025):

The issue seems to have been due to some mysterious nonsense in either my .cache/opencode or .local/state/opencode files: still not sure exactly what happened, but it seems to be resolved after clearing those folders.

Closing for now (and hopefully forever unless the problem reoccurs in the future).

@ariane-emory commented on GitHub (Dec 16, 2025): The issue seems to have been due to some mysterious nonsense in either my `.cache/opencode` or `.local/state/opencode` files: still not sure _exactly_ what happened, but it seems to be resolved after clearing those folders. Closing for now (and hopefully forever unless the problem reoccurs in the future).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3590