Repository navigation
Closed as duplicate
Closed as duplicate
Copy link
Description
Summary
OpenAI OAuth login succeeds and the credential is saved + refreshed, but the openai provider never materializes: /api/provider/openai returns ProviderNotFoundError, opencode models lists zero openai/* models, and opencode run -m openai/<model> fails with Model unavailable.
Environment
- opencode version: 2.0.29
- OS: Darwin 27.0.0 (darwin arm64)
- Terminal: TERM_PROGRAM=Apple_Terminal, TERM=xterm-256color, COLORTERM=truecolor
- Shell: /bin/zsh
- Install/channel: latest (release)
- Active plugins: @hueyexe/opencode-ensemble@0.18.0, opencode-tps-meter@latest (a broken local
plugins/model-panelwas removed during diagnosis;opencode-codex@0.3.3was tried and removed again because it fails to load on V2:PluginModule.LoadError: Plugin must export a default definition...)
Reproduction
- Remove all OpenAI credentials (
opencode auth logout openai <id>for each, verified 0 remaining via/api/credential). - In TUI run
/connect→ select OpenAI → chooseSign in with ChatGPT(chatgpt-token-sharing). opencode auth listshowsOpenAI / OpenAI / stored;/api/credentialshows the new credentialactive=true, methodchatgpt-token-sharing, fresh 1h expiry, auto-refresh working (credential updatedevents in log, no token-exchange errors).opencode models | grep openai→ empty (56 total models, all fromopencode-go/opencode/console-nvidia).opencode api get /api/provider→ only['opencode-go', 'opencode', 'console-nvidia'];GET /api/provider/openai→{"_tag":"ProviderNotFoundError","providerID":"openai"}, HTTP 404.- Repeat steps 1–2 with
Codex browser (legacy)(chatgpt-browser) andCodex device code (legacy)(chatgpt-headless) methods: credential saves cleanly each time, provider still never appears. - Same result with
--standalone(private server), so it is not a shared-service issue.
Expected Behavior
After a successful OpenAI OAuth login, the openai provider should appear with its (Codex-eligible) models, and openai/<model> should be usable.
Actual Behavior
Credential persists and refreshes with no errors, but no openai provider or models ever appear. opencode run -m openai/gpt-5 ... → Error: Model unavailable: openai/gpt-5.
Additional Context
OPENCODE_DISABLE_DEFAULT_PLUGINSis not set;/api/integrationlists all 3 OAuth methods foropenai, so method registration itself works — provider activation does not.- Log shows hundreds of historical
Failed to fetch models.dev(ENOTFOUND models.opencode.ai, timeouts,self signed certificate), but the endpoint currently returns HTTP 200 and the catalog containsopenai, so this does not explain the persistent absence after restarts. - No
OPENAI_API_KEYenv var is set (intentional — ChatGPT subscription path is the goal, API key is not an option). - V2.0.20 changelog added ChatGPT token-sharing sign-in (feat(core): add separate ChatGPT token-sharing OAuth method #52147); on 2.0.29 (latest,
opencode upgradereports nothing newer) the saved token is never wired to a provider. Consistent reproduction, not intermittent.
Metadata
Metadata
Assignees
Labels
No labels
Activity
opencode-agent commentedon Oct 14, 2026
Thanks for the very thorough report! I think this is a duplicate of #52363.
Possible duplicates and related issues, ordered from most to least likely:
openainever appears in/api/provider, andGET /api/provider/openaireturns 404ProviderNotFoundErrorwhile onlyopencode/opencode-goare listed. A commenter there found that it only happens when OpenCode Zen or OpenCode Go is connected. With OpenAI as the only connected provider, its models appear and work. Your provider list (opencode-go,opencode,console-nvidia) fits that pattern.If you want to confirm, you could disconnect OpenCode Zen/Go for a moment and check whether
openai/*models show up. Please add any results to #52363.The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.
yturkkan commentedon Oct 14, 2026
Follow-up with a version-regression datapoint — please keep this open, I don't think it's the same as #52363.
version=2.0.26up to this morning;version=2.0.29first appears today at 12:36 UTC, which is exactly when theopenaiprovider disappeared. No config/plugin change on my side at that time (only change today was an automatic update to 2.0.29).opencode-goAPI key,opencodePersonal,console-nvidia) were created Sept 21–26 and unchanged since. OpenAI OAuth worked alongside them on ≤2.0.26 and broke on 2.0.29 with zero credential/config changes. So coexistence alone doesn't explain it — something in the 2.0.26→2.0.29 delta drops theopenaiprovider record.plugin list→ none), removed the broken localmodel-panelplugin + its agents/commands/cache, retried all 3 OAuth methods (chatgpt-token-sharing,chatgpt-browser,chatgpt-headless) — credential saves + refreshes cleanly every time, provider still 404. Same result with--standalone.opencode upgradereports 2.0.29 as latest, so no fix available yet.Happy to run
OPENCODE_LOG_LEVEL=DEBUGtraces or any one-repro probe on request.yturkkan commentedon Oct 14, 2026
Correction to my previous comment on the regression window:
So the regression window is 2.0.23 → 2.0.26 (candidates: .24/.26/.27), not .26→.29 as I wrote before. Console providers (
opencode-go,opencode,console-nvidia) were connected since Sept 21–26 throughout, so this is a version regression independent of provider coexistence.opencode-agent commentedon Oct 14, 2026
Thanks for the version timing. It suggests this is not the same as #52363, so I've kept this open and looked at what changed between 2.0.26 and 2.0.29.
I couldn't reproduce it here, because it needs a real ChatGPT sign-in and your OpenCode Console account. With plain API keys for OpenAI and OpenCode, 2.0.29 lists
openai/*models next toopencode/opencode-goas expected.One change in 2.0.29 could explain it, though this is unconfirmed: OpenCode now applies organization policies sent by the connected OpenCode Console in a new place in the Console's response. Before 2.0.29 those were ignored. A policy that denies a provider removes it without any message, which would give exactly the
ProviderNotFoundError/Model unavailableyou see, starting right after the upgrade.If you'd like to help narrow it down:
opencode/ Personal) credential and restart the service (opencode service restart), then checkopencode models | grep ^openai/. If OpenAI comes back, the Console connection is what removes it.A maintainer with Console access will need to look at the rest.
yturkkan commentedon Oct 15, 2026
Test result — theory confirmed.
Steps taken (on 2.0.23, after removing all plugins and all OpenAI creds):
/connect→ OpenAI →Sign in with ChatGPT→ credential saved,active=true, no errors — butopenaistill absent (ProviderNotFoundError, 0 models).opencode auth logout opencode <Personal-credential-id>(dropped the Console connection), thenopencode service restart.GET /api/providernow includesopenai,opencode models | grep ^openai/lists 16 models (gpt-5.6/6/6.1 sol/luna/terra/astra + fast variants).opencode run -m openai/gpt-6.1-sol-fast "reply with the single word: ok"→ok. Works through the ChatGPT subscription token.So on this install the Console (
opencode/Personal) connection is exactly what removes theopenaiprovider — matches #52363. Note this reproduces with OAuth only (no API key involved, noOPENAI_API_KEYenv set), andopencode-go+console-nvidiaconnections were left in place without blocking it.yturkkan commentedon Oct 18, 2026
Retest on v2.0.32 (macOS, latest channel, binary installed 2026-10-18) — still broken, same signature as the 2.0.23 repro.
Steps:
opencode modelslists 16openai/models;opencode run -m openai/gpt-6.1-sol-fast "ok"→ok.opencode auth login opencode --method device(user code approved in browser). Log: "Connected to OpenCode Console".openai/drops 16 → 0 while the OpenAI credential stays inopencode auth list(OpenAI | OpenAI | stored). Model call:Error: Model unavailable: openai/gpt-6.1-sol-fast; server log:SessionRunnerModel.ModelUnavailableErrorat session start. Console side effects observed simultaneously:opencode/free list grows 10 → 20 (managed config delivered) and the Console MCP server appears in session tools.opencode auth logout opencode <label>+opencode service restart→openai/back to 16/16, end-to-end call returnsok, Console MCP removed.Expected per docs: local providers should co-exist with a Console connection ("Managed providers only" is opt-in and off in my setup). The desired state — Console workspace connection while still using the local ChatGPT-subscription OpenAI provider — is currently impossible.
neriousy commentedon Oct 23, 2026
Closing as a duplicate of #52363. The deterministic v2.0.32 reproduction showing OpenAI models dropping from 16 to 0 when OpenCode Console is connected has been transferred to that canonical issue.