Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(opencode): Usage → Limits no longer warns when no Console workspace is signed in #41415

Mergednthewara(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/41415/headmerged by juliusmarminge View on GitHub

Problem

Usage → Limits shows a permanent warning line for every environment that has OpenCode 2 enabled without an OpenCode Console workspace:

OpenCode: No OpenCode Console workspace is signed in.

That is the normal setup when OpenCode is signed in only through a third-party provider (here: GitHub Copilot OAuth). Nothing is wrong and there is nothing to act on, so the page should stay quiet, as it does for any other account without subscription limits.

The message has existed since #34146, but the Limits notice list used to skip every unsupported reading. #40481 made the list show an unsupported reading that carries a message (for Antigravity's sign-in prompt), with the contract "A bare unsupported reading still means the account has no limits and stays hidden." The OpenCode line is a side effect of that change meeting the older message.

Reproduce: enable OpenCode 2.x with no Console workspace signed in, open Usage → Limits.

Change

readServerUsageLimits now reports the data: null answer as a bare unsupported reading, without a message. That is what the Zen-only workspace branch a few lines below and the legacy Go key reader already return, and it is the reading the Limits page hides by contract.

One side effect: the per-account views (web /usage-limits composer panel, web thread details Limits tooltip, mobile /usage-limits panel) lose the OpenCode-specific sentence and show the generic translated "This account has no subscription limits." instead. Nothing else reads the message; the driver fallback, mobile widget, managed provider refresh, MCP tools and telemetry branch on reason only.

Scope

Bug fix for one problem: fixes #41395. Two files, the reader and its existing test case. No translations or docs mention the removed message.

Verification

How I found it: daily use. Three environments running OpenCode 2.3.2, signed in through GitHub Copilot OAuth only, each add this warning line to Usage → Limits.

What OpenCode answers (real OpenCode 2.4.0, GitHub Copilot OAuth as the only login, opencode serve):

GET /api/experimental/usage/limits?location[directory]=/tmp
HTTP 200
{"location":{"directory":"/tmp"},"data":null}

Real app, before and after. vp run dev on isolated dev state, OpenCode 2.4.0 added in Settings → Providers, Usage → Limits with the provider filter set to OpenCode. Same server and state for both captures; "before" runs main's usageLimits.ts, "after" runs this branch (the dev server restarted on the file change in between).

Before (main)After (this branch)
Before: Usage → Limits shows the warning 'OpenCode: No OpenCode Console workspace is signed in.'After: Usage → Limits shows 'No provider on the selected environments reports subscription limits.' and no warning

With the filter back on "All providers", the Codex and Claude limits still render after the fix and the page has no alert.

The side effect, on this branch: /usage-limits in the composer with an OpenCode model selected.

After: the composer usage limits panel for OpenCode reads 'This account has no subscription limits.'

Test fails on main's reader, passes with the fix. vp test run packages/provider-opencode/src/server/v2/OpenCode2Client.test.ts with usageLimits.ts checked out from main:

 FAIL  |root| packages/provider-opencode/src/server/v2/OpenCode2Client.test.ts > OpenCode2Client usage limits > distinguishes missing endpoints, signed out, and failed remote probes
AssertionError: expected 'No OpenCode Console workspace is sign…' to equal undefined

- Expected:
undefined

+ Received:
"No OpenCode Console workspace is signed in."

 ❯ packages/provider-opencode/src/server/v2/OpenCode2Client.test.ts:498:46

 Test Files  1 failed (1)
      Tests  1 failed | 17 passed (18)

With the fix, together with packages/provider-opencode/src/server/driver.test.ts:

 Test Files  2 passed (2)
      Tests  58 passed (58)

vp run check:changed passes (format, lint, knip, typecheck of 10 packages, 2 test files).

Not checked:

  • The web thread details Limits tooltip and the mobile /usage-limits panel. They read the same reading as the composer panel above, but I did not open them.
  • A server with a Console workspace signed in (Go or Zen). I have none; those branches are untouched and covered only by the existing unit tests.
  • Desktop shell, mobile, and remote or relay connections. The change is server-side in the provider reader.
  • OpenCode 1.x, which goes through the legacy reader and not this one.

Design, patch and verification by Claude Fable 5.2 via Claude Code in T3 Code.

    1. Pushed74f278f

    2. Evidence

      Enable OpenCode 2.4.0 with isolated state, a third-party xAI environment credential, no Console workspace, and no legacy Go key. Open Usage → Limits, refresh, and capture the settled result. Both runs use fresh synthetic data, dark theme, and a 1280×800 web viewport.

      Proven: the scenario fails on base and passes on head. Base shows the persistent Console-workspace warning; head shows the generic no-subscription-limits message.

      BeforeAfter
      7d8a145c6c74f278f123
      Before: OpenCode Console-workspace warningAfter: generic no-subscription-limits message without warning
      Before recordingAfter recording

      Scenario source

      Not shown:

      • Per-account views were not separately exercised; captures show the aggregate Limits view.
      • GitHub Copilot OAuth was not exercised; this reproduction used the available third-party xAI environment credential.
    3. juliusmarminge added labelstakeover:ready

    4. juliusmarminge removed labelstakeover:in-progress

    5. juliusmarminge merged this6ec46a6

    6. juliusmarminge closed this

    7. juliusmarminge removed labelstakeover:ready

Sign in to join this conversation.