Repository navigation
fix(quota): drop bespoke quota caches on upstream 429 - #16932
Open
maxmad64bis wants to merge 1 commit into
Open
maxmad64bis wants to merge 1 commit into
maxmad64bis wants to merge 1 commit into
Conversation
maxmad64bis
force-pushed
the
fix/bespoke-quota-cache-stale-after-429
branch
2 times, most recently
from
October 17, 2026 03:20
82a498a to
b177b8c
Compare
the 429 path invalidates each provider's registered quota cache, so preflight stops re-admitting a connection that just answered 429
maxmad64bis
force-pushed
the
fix/bespoke-quota-cache-stale-after-429
branch
from
October 17, 2026 03:59
b177b8c to
c19aa06
Compare
maxmad64bis
marked this pull request as ready for review
October 17, 2026 09:13
This branch has not been deployed
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.
Summary
After a real 429, the limits screen keeps the usage read before the refusal for up to a minute, and the preflight re-admits the connection just refused. That stale read comes from a 429 path that drops only the codex and generic quota caches. Each fetcher now registers how to drop its own cache, and the 429 path uses that registry, so the next preflight reads fresh usage; a non-429 response or a probe-origin failure keeps the cache.
Related Issues
Target Branch
release/v3.8.xbranch (the highest openrelease/v*), notmainv4-featurelabel for the v4 channelValidation
npm run lintTests Added Or Updated
tests/unit/quota-cache-invalidation-on-429.test.ts— new: the site and the v0/tavily fetchers refetch on a 429; other statuses, probe-origin failures and registered keys are covered.tests/unit/generic-quota-fetcher.test.ts— renamed dispatcher; the same 429, 200, probe and padding cases.tests/unit/chatcore/execute-provider-request.test.ts— new shape case: the 429 site uses the shared dispatcher.Coverage Notes
Fetcher files sit in
open-sse/services/, their test files intests/unit/.open-sse/handlers/chatCore/executeProviderRequest.ts—chatcore/execute-provider-request.test.ts,antigravity-429-quota-cooldown.test.ts.agentrouterQuotaFetcher.ts—agentrouter-quota-fetcher.test.ts.bailianQuotaFetcher.ts—bailian-quota-fetcher.test.ts.codexQuotaFetcher.ts—codex-quota-fetcher.test.ts.context7QuotaFetcher.ts—context7-quota-fetcher.test.ts.crofUsageFetcher.ts—crof-usage-fetcher.test.ts.deepseekQuotaFetcher.ts—deepseek-quota-fetcher.test.ts.firecrawlQuotaFetcher.ts—firecrawl-quota-fetcher.test.ts.genericQuotaFetcher.ts—generic-quota-fetcher.test.ts.grokCliQuotaFetcher.ts—grok-cli-quota-fetcher.test.ts.grokQuotaFetcher.ts—grok-quota-fetcher.test.ts.jinaQuotaFetcher.ts—jina-quota-fetcher.test.ts.llmgatewayQuotaFetcher.ts—llmgateway-quota-fetcher.test.ts.lyceumQuotaFetcher.ts—lyceum-quota-fetcher.test.ts.moonshotQuotaFetcher.ts—moonshot-quota-fetcher.test.ts.opencodeQuotaFetcher.ts—opencode-quota-fetcher.test.ts.openrouterQuotaFetcher.ts—openrouter-quota-6842.test.ts.quotaPreflight.ts—quota-cache-invalidation-on-429.test.ts(registry case),newapi-aggregator-preflight-dispatch.test.ts.qwenTokenPlanQuotaFetcher.ts—qwen-token-plan-quota-fetcher.test.ts.tavilyQuotaFetcher.ts—tavily-quota-fetcher.test.ts.v0QuotaFetcher.ts—v0-quota-fetcher.test.ts.xaiOauthQuotaFetcher.ts—xai-oauth-quota-fetcher.test.ts.Reviewer Notes