Repository navigation
fix(accounts): refresh OAuth quotas through read-only usage APIs - #8569
Open
Ming-Sir-69 wants to merge 4 commits into
Open
Ming-Sir-69 wants to merge 4 commits into
Ming-Sir-69 wants to merge 4 commits into
Conversation
Ming-Sir-69
force-pushed
the
fix/account-auto-refresh-usage
branch
3 times, most recently
from
November 7, 2026 14:29
a53f022 to
b94671f
Compare
Ming-Sir-69
force-pushed
the
fix/account-auto-refresh-usage
branch
from
November 14, 2026 16:33
b94671f to
ef0b5e5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automatic polling currently leaves Claude quotas stale, and OpenAI only reloads quotas when its stored account snapshot changes. As a result, the same refresh timer visibly queries Claude while OpenAI can keep showing an old value.
Connect the existing refresh timer to active quota reads for both Anthropic OAuth and OpenAI OAuth, including when the account list returns 304. Use the existing Anthropic GET usage reader and OpenAI /wham/usage reader. OpenAI active reads never invoke the synthetic /responses probe or consume a reset credit; the existing snapshot/probe path remains available to its other callers.
Automatic requests keep force=false, bypass the browser cache, merge concurrent reads and retain error backoff. OpenAI read results have a five-second success cache; explicit manual refresh bypasses successful cache entries. Slow polls finish before another timer tick replaces them. Existing Query buttons reflect the request through their loading state. Setup-token accounts keep their passive behavior.
Manual refresh keeps the existing stale-response protection. The already merged #8581 display fix is preserved without being reintroduced into this diff. This changes no scheduled-test plans, schema, account authorization, proxy assignment or automatic-reset configuration.
Validation:
CI note: the earlier backend-security run reported GO-2026-6859 in the CI Go 1.27.3 standard library (reported fixed in Go 1.27.4). This PR changes neither the toolchain pin nor workflows; security-check remediation remains separate from quota refresh.
Quota-window correctness: preserve an explicit Anthropic
five_hour: nullas an absent window rather than synthesizing 0%. Keep a real zero-percent window visible. Persist that distinction into the existing passive snapshot so reloads cannot recreate it. For OpenAI, current personal Pro tiers have no five-hour limit per official policy; active reads also honor which windows are actually reported and never resurrect a missing window from old snapshots. Plus/unknown/workspace plans retain observed limits. No account IDs, email rules or plan-name heuristics for Claude Ultra verification are hardcoded.Policy references checked 2026-11-15:
Window-presence regressions pass for explicit null, real zero, omitted/unknown, passive reload, all personal Pro tiers, Plus and stale OpenAI snapshots. Steve's read-only upstream response has
five_hour: null; the other Claude account reports a real zero window. No model-generation request was used to infer quota availability.