Repository navigation
Description
What happened
The mobile app's Usage → Limits page shows two OpenCode accounts, but the user has one OpenCode Go subscription. Row 2 matches the live numbers. Row 1 holds lower, older numbers, and its session window says "resets now" because its reset time has already passed.
| Window | Row 1 (left) | Row 2 (left) | Live API now (left) |
|---|---|---|---|
| Session (rolling) | 97%, resets now | 100%, 1h 28m | 99% |
| Weekly | 97%, 4d 9h | 82%, 4d 9h | 82% |
| Monthly | 87%, 11d 0h | 79%, 11d 0h | 79% |
Both rows share the same weekly and monthly reset times, so they are the same subscription. Row 1 looks like a snapshot from earlier in the week.
Diagnosis
OpenCode Go reports no email, so accountKey (packages/shared/src/usageLimits.ts) identifies the account only by credentialFingerprint, a hash of the API key (packages/provider-opencode/src/server/usageLimits.ts). One subscription can have several API keys. An environment using a different key for the same subscription becomes a second account, and collectLimitAccounts never merges the two.
The environment that produced row 1 is not the desktop host. That host has a single active Go key, and its reading matches row 2 exactly. Its only other stored key is inactive and returns 401 api_key_expired. Row 1 most likely comes from another connected environment with a different Go key that has not refreshed this week. I could not inspect the phone's environment list from the host.
The usage response ({"usage":{"rolling","weekly","monthly"}}) and the stored credential carry no account or workspace ID, so T3 has nothing better to match on today.
Suggested fix
Treat two OpenCode Go readings as one account when their monthly resetsAt matches to the second. The monthly window is anchored to the subscription's start (here 2026-11-15T15:39:18Z), so two different subscriptions are very unlikely to share it. Once the rows merge, collectLimitAccounts already keeps the fresher reading, so the old row disappears with no extra stale handling.
Steps to reproduce
- Sign two environments in to the same OpenCode Go subscription with two different API keys.
- Connect both to the mobile app.
- Use OpenCode on one environment, and leave the other one offline or unrefreshed.
- Open Usage → Limits. OpenCode shows two accounts with different percentages and the same weekly and monthly reset times.
Version
Desktop host server: 0.1.7-nightly.20261103.4106. The other environment's version is unknown. The triage CLI was 0.1.7.
Environment
Windows 11 desktop host, plus the Android mobile app connected through T3 Connect. OpenCode Go subscription. Code references are from main at 9e85538.
Evidence
Live `GET https://opencode.ai/zen/go/v1/usage` with the host's active key: rolling 1% used, weekly 18% used (resets 2026-11-09T00:00Z), monthly 21% used (resets 2026-11-15T15:39Z). This matches row 2. The host's inactive key returns `401 api_key_expired`. Screenshots are attached below.Related issues
#10701 (closed), which deliberately keeps email-less accounts separate. #23054, a Codex tile per environment.
Fix applied or workaround
None applied. Workaround: use the same OpenCode Go API key on every environment.
Filed by
Claude Opus 5.5 (claude-opus-5-5) in Claude Code, running inside T3 Code, via t3 triage.
Activity