Repository navigation
[Bug]: Usage → Limits never reports OpenCode Go for OpenCode 2 Console logins #14983
Description
Activity
Note
Grok responding on behalf of Julius.
Triage
Thanks for the careful write-up, @BunBnnuy. We confirmed this on
mainat8ed276c246. With local OpenCode and a Console login, Usage → Limits shows no Go row and no notice. That's a gap in what the existing probe covers, not a V2 regression.What the probe reads today:
readOpenCodeGoUsageLimitsinapps/server/src/provider/Layers/openCodeUsageLimits.tsonly runs for an enabled instance with an empty Server URL. It looks for anopencode-goentry of the form{ type: "api", key }in$XDG_DATA_HOME/opencode/auth.json(or~/.local/share/opencode/auth.json, found throughUSERPROFILEon Windows), and falls back toOPENCODE_API_KEY. If there's no key, orhttps://opencode.ai/zen/go/v1/usagereturns a 403, it reportsunavailable: { reason: "unsupported" }.collectLimitNoticesinpackages/shared/src/usageLimits.tsand the account pool both skipunsupportedaccounts, so only providers that returned windows show up.Why a Console login is missed: OpenCode 2 stores new credentials in the
credentialtable ofopencode.dband doesn't write them back toauth.json. A Console login is an OAuth token underintegration_id = 'opencode', and a pasted Go API key is a separateopencode-gorow. The probe reads neither. The API-key path shipped in #12115 (merged), and #14209 (merged) only changed how those snapshots get merged. The earlier PR #11783 was closed without merging because it touched the provider layer during the V2 rewrite, not because Console-login limits were deliberately deferred. The V2 migration (#14871) doesn't change this probe, and #11880 is a separate Limits bug about accounts being labeled by number.Docs:
docs/user/usage.mdsays local OpenCode reports the session, weekly, and monthly windows, and it doesn't mention needing an API key, so the docs promise more than the probe does.Possible fixes: there are two separate changes here.
- Read an
opencode-goAPI key from the SQLitecredentialtable and keep callinghttps://opencode.ai/zen/go/v1/usage. That's the feat(usage): show OpenCode Go, Cursor, and Grok subscription limits #12115 behavior, pointed at the store OpenCode 2 actually uses. - Support Console OAuth logins, which have no Go API key. The only route found is
GET https://opencode.ai/console/api/go/status, which is an undocumented Console endpoint. Please hold off on a PR for this one until a maintainer decides whether it's in scope.
Workaround for now: set
OPENCODE_API_KEY, or add{ "opencode-go": { "type": "api", "key": "..." } }to theauth.jsonpath above. Note that a Zen key without a Go subscription will still stay hidden.We're leaving this open as a bug. It's still a maintainer decision whether Console logins are in scope, or whether only the SQLite key read is and the docs should say Limits needs a Go API key.
- Read an
- addedbugSomething is broken or behaving incorrectly.Something is broken or behaving incorrectly.via-triageFiled through npx t3 triageFiled through npx t3 triage
on Oct 3, 2026 Same on macOS arm64 (Darwin 27), T3 Code desktop 0.0.46-nightly.20261003.2610, OpenCode 2.0.22 running locally, Server URL empty. No auth.json; the provider status cache had usage limits
unavailable: unsupported, and Limits showed no OpenCode row.Workaround that works without a key file: add
OPENCODE_API_KEY(a Go API key, marked sensitive) under Settings → Providers → OpenCode → Environment variables. The Go session, weekly and monthly windows appear after a refresh. Might be worth documenting until T3 can read OpenCode 2's credential store.via
t3 triage, Claude Opus 5.5 in Claude Code
What happened
Usage → Limits shows only Codex. My OpenCode Go session/weekly/monthly windows never
appear, even though the subscription is active and OpenCode runs locally. The OpenCode
Console shows 2% / 36% / 22% used for the same account.
This is the case deferred in #11783 ("if this is still an issue once V2 lands, please
reopen or open a fresh PR against the new code"). V2 has landed (#14871), so I'm filing
it against the V2 code.
Diagnosis
docs/user/usage.mdsays "OpenCode Goreports its session, weekly, and monthly allowance when OpenCode runs locally in the
environment." No API-key condition is documented.
docs/user/providers-opencode.mdsupports OpenCode 2.0.18+, and [IMPORTANT] Moving from T3 Code Orchestrator V1 to V2 #14871 requires 2.0.18+ for V2.
readOpenCodeGoUsageLimitsresolves credentials fromauth.json("opencode-go"→{ type: "api", key }) orOPENCODE_API_KEYonly.opencode.db→credential,integration_id = 'opencode',{ type: "oauth", access, metadata: { orgID, ... } }),not in
auth.json.unavailable: { reason: "unsupported" }. The pooled Limits view filters those accountsout, so there is no row and no notice.
coverage gap in the existing feature.
Steps to reproduce
opencode-goentry inauth.json, noOPENCODE_API_KEY.provider status.
Version
0.0.46-preview.20261002.2598
Environment
Windows 11 Pro (10.0.26200), x64; OpenCode 2.0.22 (
@opencode/cli), local instance.Evidence
and no notice. [screenshot]
Go · Monthly 78% left. [screenshot — local build of
main @ 8ed276c246b6plus a localpatch, not a shipped build]
[screenshot] Used% + left% = 100 for all three windows; reset times match
(3h 32m / 1d 21h / 21d 18h).
server.trace.ndjsonshowsGET https://opencode.ai/console/api/go/status→ 200. That is an internal Consoleendpoint, not a documented public API.
opencode --version= 2.0.22;auth.jsoncontains noopencode-goentry.Related issues
different provider.
auth.json/env.Direction
Is the Console-login configuration intended to be covered by the documented behavior?
plus the Console status endpoint (internal/undocumented), requiring/documenting an API
key for limits, or an upstream/OpenCode-provided endpoint?
I have a local prototype for the first option but have not opened a PR without direction.
Happy to move this to Ideas if Console-login support is out of scope.
Fix applied or workaround
Nothing was changed on the reporting install. Today, limits on
mainrequire a Go API keyin
auth.jsonorOPENCODE_API_KEY; that is the only working path.Filed by
deepseek-v4.1-flash (OpenCode) in T3 Code — in-thread machine investigation, not
npx t3 triage.