Repository navigation
fix(usage): explain the ChatGPT token-sharing quota limitation - #999
Conversation
The Usage panel reported a temporary failure for the native chatgpt-token-sharing sign-in. OpenAI does not currently expose quota reads for that grant, so the message incorrectly suggested that waiting or reconnecting could restore the counters. Identify this method only on the selected active OpenAI credential and return a fixed, credential-free unavailable reason through the existing Usage response. Localize the explanation in all ten UI languages. Existing Codex eligibility, account/Location fences, cache invalidation and native token ownership remain in place. Unsupported credentials make no provider quota request; other failures retain their existing classification. This is an interim diagnostic correction. OpenAI's confirmation is linked in the reader and provider-account documentation. OpenChamber's equivalent change, commit 22aa4d811 / PR 4612, also explains denied quota access and continues to use the same Codex endpoint. Validation: 19 server tests cover native quota selection, account changes, cache revocation, API routes and credential redaction. All 14 provider-usage browser tests pass, including English/French explanations at 320 px and recovery after an account change. The browser suite now uses an isolated Vite dependency cache. Typechecks with ES2022 libraries report exactly the same diagnostics as the untouched baseline: 14 server errors and the known UI help-url.test.ts error. No installed application or service was restarted.
pascalandr
left a comment
There was a problem hiding this comment.
Independent gatekeeper review of exact HEAD 6742620d0153ae1fee6b3f7e0c25b4a8d4dfdf5b against dev (920e8d81ee1a1946e92c1c2f75768b87209b455e).
Zero actionable P0–P3 findings.
The diagnosis is restricted to the selected active OpenAI OAuth entry with chatgpt-token-sharing. It adds no provider request, credential fallback, secret exposure or automatic-selection eligibility; existing account/connection fences and legacy quota behavior remain intact. The explanation matches OpenAI's documented limitation, is present in all 10 locales, and does not claim to restore token-sharing quotas.
Validation independently rerun: 19/19 targeted server tests, 14/14 provider-usage browser tests (including English/French at 320 px), and git diff --check passed. Tests used isolated fixtures.
Summary
Explain why Usage is unavailable for OpenCode's
chatgpt-token-sharinglogin instead of calling it a temporary failure. The native reader recognizes only the selected active OpenAI credential and returns a fixed reason. The existing panel renders its explanation in all ten locales.This is the interim message requested while quota retrieval for this login remains unresolved. It does not restore those counters. Codex browser/device logins keep their current quota reader; no credential refresh, account substitution or additional provider request is introduced.
Evidence
2e3e194d2a14e1fc5d0482b589c57d916d6ad0d6. Its Codex fix #4612 diagnoses the access refusal; it still calls the same usage endpoint.Validation
node --import tsx --test src/usage/native-codex.test.ts src/usage/codex-credential.test.ts src/server/routes/usage.test.tsinpackages/server: 19 passed.node --import tsx --test --test-concurrency=1 tests/browser/provider-usage.test.tsinpackages/ui: 14 passed. English and French messages fit a 320 px panel; switching back to a supported account restores the bars.help-url.test.ts. The standard server config additionally reports existing ES2020Array.aterrors.Existing oversized files touched:
packages/server/src/api-types.tsat about 885 lines andpackages/ui/src/lib/i18n/messages/*/settings.tsat about 760–775 lines.