Skip to content

fix(opencode): show the selected ChatGPT account’s allowance and resets - #41772

Closed
razzeee wants to merge 2 commits into
pingdotgg:mainfrom
razzeee:worktree/show-openai-resets
Closed

razzeee wants to merge 2 commits into
pingdotgg:mainfrom
razzeee:worktree/show-openai-resets

Conversation

@razzeee

@razzeee razzeee commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Problem

With a local OpenCode 2 instance signed in to ChatGPT and no Console or Go allowance, Usage Limits could not show when the subscription allowance would reset.

Change

Read the selected ChatGPT login from OpenCode’s database only when Console and Go have no limits to report. The probe does not refresh or write credentials. Remote instances never read host credentials.

Match each reading to the project model and workspace that spend the allowance. When two instances share a login, Thread Details uses the fresher reading but keeps the selected instance’s model catalog for matching.

Scope

Follows up on PR #22885. This fixes the existing Limits view before a request fails. PR #26264 handles a different path: the reset time on a failed request.

Verification

  • Before: the Thread Details regression showed the older instance’s October 30 reset even though the same login had a newer October 31 reset.
  • After: the same test shows October 31. Probe tests cover Console and Go precedence, retry after local database discovery fails, and remote credential isolation. A live read returned a weekly reset of 2026-11-25T11:24:44Z.
  • After rebasing onto main, vp run check:changed origin/main passed, including 823 tests and typechecking across 43 packages. In the same local environment, Usage → Limits on the base commit showed no subscription limits. On the PR head it showed OpenCode’s ChatGPT weekly allowance: 13% left, resetting in 1d 10h.

GPT-6.2 Astra via OpenCode.

A project can route a model through a different account than the host
catalog does. Use the project catalog for thread limits and fallback
selection, and discard stale readings when the selected login changes.
When Console and Go report no limits, read the selected local
OpenCode 2 login without refreshing or writing its credentials.
Only apply its allowance to routes that use that ChatGPT workspace.
@github-actions

Copy link
Copy Markdown
Contributor

Closing: razzeee already has 3 or more open PRs here, which is the limit for contributors who are not vouched.

Once one of them is merged or closed, open this again. See the open PR limit.

@github-actions github-actions Bot closed this Nov 24, 2026
@github-actions github-actions Bot added vouch:unvouched Author is not yet trusted in the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 changed lines (additions + deletions). vouch:unvouched Author is not yet trusted in the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant