Skip to content

fix(usage): explain the ChatGPT token-sharing quota limitation - #999

Merged
pascalandr merged 1 commit into
devfrom
fix/openai-quota-sign-in
Oct 18, 2026
Merged

pascalandr merged 1 commit into
devfrom
fix/openai-quota-sign-in

Conversation

@pascalandr

Copy link
Copy Markdown
Contributor

Summary

Explain why Usage is unavailable for OpenCode's chatgpt-token-sharing login 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

Validation

  • node --import tsx --test src/usage/native-codex.test.ts src/usage/codex-credential.test.ts src/server/routes/usage.test.ts in packages/server: 19 passed.
  • node --import tsx --test --test-concurrency=1 tests/browser/provider-usage.test.ts in packages/ui: 14 passed. English and French messages fit a 320 px panel; switching back to a supported account restores the bars.
  • Server and UI typechecks with ES2022 libraries have identical diagnostics to the untouched baseline, verified through a compiler read overlay: 14 server errors and one UI error in help-url.test.ts. The standard server config additionally reports existing ES2020 Array.at errors.
  • Screenshots inspected locally. No installed build replacement or shared-service restart.

Existing oversized files touched: packages/server/src/api-types.ts at about 885 lines and packages/ui/src/lib/i18n/messages/*/settings.ts at about 760–775 lines.

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 pascalandr left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@pascalandr
pascalandr merged commit 16fad52 into dev Oct 18, 2026
13 checks passed
@pascalandr
pascalandr deleted the fix/openai-quota-sign-in branch October 18, 2026 02:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant