anomalyco / anomalyco/opencode

ChatGPT model-name filter hides explicitly configured Daybreak model

Open
#49,806 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

With ChatGPT OAuth authentication, OpenCode 2.0.8 silently hides the explicitly configured model openai/gpt-daybreak-blue-latest. This was working while I was using opencode2 during the beta.

The model is present in the configuration returned by /api/config, but absent from /api/model and the model picker. Other OpenAI models remain available.

The cause appears to be the OpenAI plugin’s model-name filter:
https://github.com/anomalyco/opencode/blob/v2.0.8/packages/core/src/plugin/provider/openai.ts#L264-L292

It matches the API model ID against /^gpt-(\d+)(?:\.(\d+))?/ and sets enabled = false when the name is neither allowlisted nor a qualifying numbered GPT model. gpt-daybreak-blue-latest fails that check regardless of its explicit configuration.

Expected: explicitly configured models should have a supported way to opt out of this name-based heuristic, with actual account access validated by the backend. At minimum, the UI should explain why a configured model was hidden.

Plugins

built-in plugins only

OpenCode version

2.0.8

Steps to reproduce
  1. Connect OpenAI using ChatGPT OAuth, ensuring user has TAC (chatgpt.com/cyber)

  2. Add this to ~/.config/opencode/opencode.json:

    {
      "$schema": "https://opencode.ai/config.json",
      "providers": {
        "openai": {
          "models": {
            "gpt-daybreak-blue-latest": {
              "name": "GPT Daybreak Blue (Latest)",
              "capabilities": {
                "tools": true,
                "input": ["text", "image"],
                "output": ["text"]
              },
              "limit": {
                "context": 400000,
                "input": 272000,
                "output": 128000
              }
            }
          }
        }
      }
    }
    
  3. Open the model picker and search for Daybreak.

  4. Confirm /api/config contains the entry, while /api/model omits it.

Screenshot and/or share link

No response

Operating System

Linux x86_64, WSL2; kernel 6.18.33.2-microsoft-standard-WSL2.

Terminal

Windows terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in packages/core/src/plugin/provider/openai.ts at lines 264-292 and reproduce the discrepancy between /api/config and /api/model with the provided configuration. Trace how the model-name filter affects the model picker, then verify that an explicitly configured Daybreak model is no longer silently omitted and that the intended access behavior is preserved.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.