fix(codex): isolate Spark quota and stabilize quota UI - #6336
diegosouzapw merged 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for Codex-specific quotas, including Spark session/weekly limits and banked reset credits. It updates the UI columns, sorting, and caching mechanisms to handle these new fields, and refactors the credential selection logic to use a request-aware quota exhaustion check (isQuotaExhaustedForRequest) instead of a generic connection-wide check. A critical issue was identified in src/domain/quotaCache.ts where isQuotaExhaustedForRequest uses every instead of some to check for exhausted scoped windows, which would incorrectly allow requests to proceed even if one of the required quota windows is fully exhausted.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| return ( | ||
| scopedWindowNames.length > 0 && | ||
| scopedWindowNames.every( | ||
| (windowName) => getQuotaWindowStatus(connectionId, windowName, 100)?.reachedThreshold | ||
| ) | ||
| ); |
There was a problem hiding this comment.
Using every here means the connection will only be considered exhausted for the requested model if all of its scoped windows are exhausted. However, if even a single scoped window (such as session or weekly) is exhausted, any request to that model will be blocked and return a 429. To prevent sending requests to connections with partially exhausted quotas, this should use some instead of every.
| return ( | |
| scopedWindowNames.length > 0 && | |
| scopedWindowNames.every( | |
| (windowName) => getQuotaWindowStatus(connectionId, windowName, 100)?.reachedThreshold | |
| ) | |
| ); | |
| return ( | |
| scopedWindowNames.length > 0 && | |
| scopedWindowNames.some( | |
| (windowName) => getQuotaWindowStatus(connectionId, windowName, 100)?.reachedThreshold | |
| ) | |
| ); |
1c21083 to
75f1fd9
Compare
Co-authored-by: diegosouzapw <diegosouza.pw@gmail.com>
9570805
into
diegosouzapw:release/v3.8.46
|
Merged into |
…6336) isolate Spark quota + stabilize quota UI (diegosouzapw#6336). Tests 44/44, no file-size drift from its files. Integrated into release/v3.8.46.
…6336) isolate Spark quota + stabilize quota UI (diegosouzapw#6336). Tests 44/44, no file-size drift from its files. Integrated into release/v3.8.46.
Summary
codex/gpt-5.5.bankedResetCreditsthrough provider-limits cache serialization and stale refresh fallback so Banked Reset Credits can render without requiring a manual Refresh Now.Context
Production on v3.8.44 already had per-window
quota_snapshots.is_exhaustedfrom #5941, but lazy hydration still promoted any exhausted snapshot row into connection-level exhaustion. When the Spark weekly window was exhausted and normal Codex windows still had quota, the quota-aware selection path could treat the whole Codex connection as exhausted and return 429 for normal Codex traffic. This keeps the #4293/#5941 per-window model boundary during selection/hydration.Tests
node --import tsx/esm --test tests/unit/codex-quota-selection-hydration.test.ts tests/unit/sse-auth.test.ts tests/unit/provider-limits-ui.test.ts tests/unit/provider-columns.test.ts tests/unit/db-provider-limits.test.ts tests/unit/provider-limits-recovery.test.tsnpm run check:file-sizenpm run check:dead-codenode node_modules/typescript/bin/tsc --pretty false -p tsconfig.typecheck-core.jsongit diff --check