Repository navigation
Closed as not planned
Closed as not planned
Copy link
Description
Summary
A connected OpenCode Console account is fully valid — the Console config endpoint returns 52 opencode models — but the opencode provider never registers: /api/provider omits it and /api/model contains zero opencode/* models. opencode-go (served from models.dev) works.
Environment
- opencode v2.1.3 (latest, 2026-10-23)
- Ubuntu 24.04 (Linux x64), self-hosted
opencode serve --serviceon0.0.0.0:4096 - Config: V2
providers(no legacyproviderkey),enterprise.url = https://opencode.ai/console - Service env:
OPENCODE_API_KEYandOPENCODE_CONSOLE_TOKENboth set to the sameoc_sk_...service key
Evidence
GET https://opencode.ai/console/api/v2/config with the same key → HTTP 200:
{ "providers": {
"opencode": { "name": "...", "headers": {...}, "models": { /* 52 models */ } },
"opencode-go": { "name": "...", "headers": {...}, "models": { /* 0 models */ } }
} }Credential + account state (from ~/.local/share/opencode/opencode.db):
account:[email protected], urlhttps://opencode.ai/console,token_expiry≈ 2026-11-19 (not expired)account_state:active_account_idset,active_org_id = wrk_01KWC3KGW…credential: integrationopencode,active=1, key = sameoc_sk_…
But the server reports:
GET /api/provider→["opencode-go","nvidia","9router","byteplus-plan","agnes-paid","agnes-cripperz","muse-direct","lmstudiomac","ollamamac","tencentdb-agent-memory"]— noopencodeGET /api/model→ 149 models, 0 withproviderID: "opencode"opencode models→ noopencode/*entries
What I tried
providers.opencodeblock removed entirely (let the built-in Console provider register) → still absent.providers.opencodedefined in the documented V2 shape (package: @opencode/ai/providers/openai-compatible,settings.baseURL: https://opencode.ai/inference/openai/v1,settings.apiKey: {env:OPENCODE_API_KEY},headers.x-opencode-org-id) → still absent from/api/provider(the block is present inopencode debug config).opencode service set env OPENCODE_API_KEY <key>+opencode service restart→ still absent.opencode auth listshowsOpenCode Console — API key (stored)+OPENCODE_API_KEY (environment).
Expected
opencode provider registered with its 52 Console models, selectable as opencode/<model>.
Notes
opencode-gois present with 28 models (models.dev path), so the Console gateway credential works.- This may be related to core: all models.dev providers disappear when the catalog fetch fails #57458 (catalog/provider registry), but here the models.dev catalog is demonstrably loaded (10 providers, 149 models); only the Console-registered provider is missing.
- Desktop/TUI symptom:
opencode/*models are simply absent from the picker.
Metadata
Metadata
Assignees
Labels
No labels
Activity
opencode-agent commentedon Oct 23, 2026
Thanks for the detailed report. I tried to reproduce this on v2.1.3 and couldn't. I used a mock Console that returns a config shaped like yours (
opencodewith models,opencode-gowith none), a storedopencodeAPI-key credential, andopencode serve. I also tried each of these:OPENCODE_API_KEYandOPENCODE_CONSOLE_TOKENset to the same key as wellenterprise.urlplus custom V2providersproviders.opencodeblock like your second attemptIn every case
/api/providerlisted bothopencode-goandopencode, and/api/modelhad theopencode/*models.So something in your setup must be different. These would help narrow it down:
opencode debug config, with keys and URLs redacted. In particular, any setting that enables, disables or filters providers.opencode auth list. Your database shows anaccountrow as well as the key credential, so do you also have a signed-in Console account (OAuth), and which credential is active?--log-level debug, especially any line containingfailed to load OpenCode provider config. For the service, check the journal or runopencode servein the foreground with the same environment.opencode-gofromGET /api/provider(itsintegrationID,activationandheaders), and whether it still appears if you stop the service and runopencode servedirectly.You can reply here, or edit the issue and leave a comment saying you've updated it.
cripperzprodigy commentedon Oct 23, 2026
Update: device-flow auth succeeded, provider still absent — plus a concrete clue
After filing this, I completed
opencode auth login "OpenCode Console" --method devicesuccessfully:opencode auth listnow showsOpenCode Console — Default — stored(session) alongside the API key + env entries.accountrow unchanged ([email protected], token expiry 2026-11-19).opencode service restart) →/api/providerstill lists 10 providers withoutopencode;/api/modelstill 0opencode/*.Clue — the Console config endpoint requires
x-org-idfor account session tokens:With the account
access_token(st_…):Note the header name differs from the inference path: the Console config API wants
x-org-id, while the OpenCode docs/examples usex-opencode-org-idfor inference. If the provider-sync call sendsx-opencode-org-id(or omits the org), it getsorg_requiredand the provider is silently dropped — which would match the observed behaviour exactly.The service key (
oc_sk_…) works without any org header (200), so the failure is specific to the account-session path.Repro host: v2.1.3, Ubuntu 24.04,
opencode serve --service,account_state.active_org_id = wrk_01KWC3KGW….cripperzprodigy commentedon Oct 23, 2026
Correction — this is not a bug; closing
I found the actual cause on the reporting host:
opencode.jsoncontainsThis policy deliberately disables the pay-as-you-go
opencodeprovider (the account has nofunds —
402 Insufficient account funds), whileopencode-goremains available. The provider istherefore correctly absent from
/api/providerand/api/model; the Console still advertising52 models is expected (the catalog is independent of the local policy).
The device-flow re-auth and the
x-org-idobservation are still accurate data points, but theyare not a defect. Sorry for the noise — closing as not-a-bug.
opencode-agent commentedon Oct 26, 2026
I'm closing this for now because we couldn't reproduce it and haven't heard back. On v2.1.3, with a Console config shaped like yours, the
opencodeprovider and its models showed up next toopencode-goin every setup I tried: a stored key, theOPENCODE_API_KEY/OPENCODE_CONSOLE_TOKENenv vars,enterprise.url, and a customproviders.opencodeblock. Without your config,opencode auth listoutput and server logs, we can't tell what's different on your side.If it still happens, please reply with the details from my earlier comment and we can reopen it:
opencode debug config, redactedopencode auth list--log-level debug, especially anyfailed to load OpenCode provider configlineopencode servein the foreground instead of as a serviceThanks for the detailed report.