Repository navigation
Description
What happened
After updating to 0.1.10-nightly.20261113.4656, Usage → Limits shows no OpenCode Go row for local OpenCode instances that are authenticated with a Go API key only. On 0.1.9-nightly.20261110.4478 the same instances showed their Go session, weekly and monthly windows.
A remote environment whose OpenCode is signed in to a Console workspace still shows its row. With two Go accounts on this machine (two OpenCode provider instances, each with its own XDG_DATA_HOME), neither appears.
Diagnosis
- The new path. In 0.1.10, the OpenCode provider's
checkUsageLimitsprefers the V2 server reading for a v2 runtime:openCode2Server.withConnection((c) => c.usageLimits(cwd)). It falls back toreadOpenCodeGoUsageLimits(the Go-key reader) only when that returnsundefined. - When it returns
undefined.readServerUsageLimitsdoes so only for HTTP 404, 405, or a 200 with an HTML body. - What a key-only instance gets. With no Console workspace signed in, OpenCode 2.3.0's
GET /api/experimental/usage/limitsanswers 200 with{"data": null}. That becomesmakeUnavailableUsageLimits({ reason: "unsupported", message: "No OpenCode Console workspace is signed in." }), which is notundefined, so the Go-key reader never runs and the account shows nothing. - The Go key works.
GET https://opencode.ai/zen/go/v1/usagewithAuthorization: Bearer <go key>returns 200 withrolling,weeklyandmonthlyfor both accounts. That is the callreadOpenCodeGoUsageLimitsmakes. - Likely origin. This looks like a side effect of the V2 server path that addressed [Bug]: Usage → Limits never reports OpenCode Go for OpenCode 2 Console logins #14983 (Console logins not reported). This report is the inverse: key-only accounts.
Suggested fix: treat data: null as "the server cannot read this account". Either:
- return
undefinedfromreadServerUsageLimitswhenbody.data === null; or - fall back to
legacyUsageLimitsincheckUsageLimitswhen the server result isunsupported.
Key-only accounts then keep the Go-key reader, and Console logins keep the server path.
Steps to reproduce
- Authenticate OpenCode 2.3.0 with an OpenCode Go API key only, with no Console workspace. Either:
auth.json→"opencode-go": { "type": "api", "key": ... }; or- an
opencode.dbcredentialrow withintegration_id = 'opencode-go'andtype: "key".
- Add it as an OpenCode provider instance in T3 Code 0.1.10.
- Open Usage → Limits: there is no OpenCode Go row for that instance.
- Query the instance's OpenCode server directly:
curl -u opencode:<server password> "http://127.0.0.1:<port>/api/experimental/usage/limits?location%5Bdirectory%5D=<project dir>"
It returns{"data":null}. - On 0.1.9 the same instance shows its Go windows.
Version
0.1.10-nightly.20261113.4656 (a regression from 0.1.9-nightly.20261110.4478)
Environment
Linux (WSL2), OpenCode 2.3.0, two OpenCode provider instances with separate XDG_DATA_HOME (two Go accounts, API keys only).
Evidence
# each local OpenCode server, as T3 calls it
GET /api/experimental/usage/limits?location[directory]=… -> 200 {"data":null}
# the Go key, as readOpenCodeGoUsageLimits calls it
GET https://opencode.ai/zen/go/v1/usage (Bearer <go key>) -> 200 {"usage":{"rolling":{...},"weekly":{...},"monthly":{...}}}
Activity