Repository navigation
[Feature]: estimate effective Codex quota capacity from observed usage and quota history #2344
Description
Activity
- addedaccount-poolOAuth, credentials, Codex pool, quota, failover, plansOAuth, credentials, Codex pool, quota, failover, plansguiDashboard, tray, settings UIDashboard, tray, settings UI
on Aug 22, 2026 리뷰 · 우선순위 43 / 80
설명: 이 이슈는 Codex 할당량 창이 실제로 얼마나 큰지를, 지금 보는 퍼센트 막대가 아니라 관측된 사용량과 퍼센트 변화로 추정하자는 기능 요청이다. 지금 CURRENT
devHEAD는67b5fa019이다. 이 시간에 착지한 것은 Cursor 카탈로그와 문서다:#2345릴리스 준비 문서(인벤토리·위험 매트릭스·로드맵 lock + 300/310 프로브 보정),#2346Opus Fast 패밀리 노출(claude-opus-4-7-fast티어 확정,claude-opus-4-8-fast/claude-opus-5-fast추가, bare-fast아이디는 와이어에 안 감),#2347maxMode 큰 컨텍스트 A/B는 NOOP(메시지당 약 1MiB 상한, 서버가 옛 히스토리를 자름). 이 이슈의 대시보드/할당량 레인과 그 머지들은 파일이 겹치지 않는다. 현재 HEAD에서 할당량 저장은 src/codex/quota.ts 의 StoredAccountQuota 한 줄이다. 디스크 파일 이름은 QUOTA_CACHE_FILENAME 이 가리키는 codex-quota-cache.json 이고 version 1 이며 계정당 최신 스냅샷만 둔다. 주간/월간/짧은창 퍼센트와 reset_at, updatedAt 은 있지만 t0 와 t1 을 나란히 남겨 두지 않는다. updateAccountQuota 는 기존 필드를 펼친 뒤 새 퍼센트로 덮어 쓴다. 디스크에서 다시 읽을 때 QUOTA_DISK_MAX_AGE_MS 가 6시간이라 재시작 후 오래된 숫자도 버린다. 그래서 42%에서 47%로 올랐다를 나중에 재구성할 원시 값이 없다. 사용량 쪽은 이미 시간축이 있다. src/usage/log.ts PersistedUsageEntry 는 요청마다 timestamp, 모델, 토큰, 계정 라벨을 남긴다. src/usage/summary.ts 는 7일/30일/전체와 날짜별 UsageDay 를 만들고 표시용 estimatedCostUsd 도 더한다.#1058날짜 필터는 이미 닫혀 착지했다.#1820은 아직 OPEN 이지만 달러 추정은 요약에 들어 있다. 다만 이 이슈가 말하는 Codex-equivalent credits 라는 권위 단위는 아직 없다. 달러는 표시용 추정이고 할당량 가중치와 같은 값이 아니다. 화면 gui/src/components/provider-workspace/ProviderUsage.tsx 는 최근 30일 비용/요청/토큰 블록 아래에 QuotaBars 를 같은 탭에 그린다. 나란히 있을 뿐 퍼센트 델타로 사용량을 나누지 않는다. 이 이슈가 지적한 구멍은 맞다. 본문의 실패 닫힘(다른 reset_at 끼워 계산 금지, 퍼센트 감소 버림, 1%p 전후는 미확정, 우리 트래픽만, 공식 한도라고 쓰지 말 것)은 현재 코드와도 맞다. Cursor#2334CursorCredentialRouter 는 여전히 src/providers/cursor-pool.ts 모듈+테스트만 있고 어댑터에 연결되지 않았다.#2332H2 풀은 src/adapters/cursor/live-models.ts discovery 전용이고, 종료 훅은#2338로 붙었다. Run 경로는 자기 세션을 쓴다.#2320overflow 매핑은 dev 에 있고#2342size prior 가 provably-small 만 429 로 좁힌다. 카탈로그 팁은 Ox Alphax-preview-f-free+deepseek-v4-flash-vision-exp.#2346으로 Cursor Opus Fast 패밀리가 추가됐지만 이 이슈와 무관하다. package.json 은 아직 2.27.0, 태그는 v2.29.0. 프리뷰 배포는 계획에 없다.#2188사이드카+routed vision 은 이미dev. types.ts/config.ts 스플릿과 이 이슈의 첫 PR이 설정 키를 같이 만지면 리베이스하지 말고 닫고 다시 연다. 할당량 창 크기를 숫자로 보고 싶은 운영 기능이라 43.src/codex/quota.ts StoredAccountQuota / QuotaDiskFile version 1 - 계정당 최신 한 줄만. 히스토리 배열이 없어서 t0·t1 을 다시 만들 수 없다
src/codex/quota.ts QUOTA_DISK_MAX_AGE_MS / updateAccountQuota - 덮어쓰기 + 재시작 후 6시간 넘은 스냅샷 폐기. 퍼센트 델타의 원본이 사라진다
src/usage/log.ts PersistedUsageEntry / src/usage/summary.ts UsageDay estimatedCostUsd - 사용량 시간축과 날짜 분해, 달러 추정은 있다. 할당량 % 와는 안 이음. Codex-equivalent credits 단위는 없다
gui/src/components/provider-workspace/ProviderUsage.tsx QuotaBars - 사용량 블록과 막대가 같은 탭에 있어도 나눗셈이 없다
issue #1820 OPEN vs #1058 closed - 날짜 필터는 착지. 달러 추정은 요약에 있음. Codex-equivalent credits 는 없고 이 이슈를 그 둘과 한 PR로 묶지 말 것메인테이너의 판단이 필요한 지점
- 지금 할당량 관측 히스토리만 먼저 넣을지,
#1820의 정규 사용량 단위가 끝난 뒤로 미룰지 - 저장을 기존 codex-quota-cache.json version bump 로 할지, 길이 제한 있는 별도 파일로 할지
- 화면을 Usage 탭에 붙일지 Codex 계정 풀 카드에 붙일지. 외부 클라이언트 사용 때문에 추정치가 작아 보일 수 있음을 기본 문구로 얼마나 강하게 쓸지
너의 추천
이 이슈는 연다. 지금 Cursor round-3 / 릴리스 준비 레인(#2346카탈로그,#2347maxMode NOOP,#2334미연결 라우터)을 막거나 묶지 않는다. 첫 PR은 할당량 관측 히스토리만 넣는다. 이메일·토큰 없이 퍼센트와 reset_at 과 updatedAt, 계정당 길이 제한. 용량 나눗셈과 API-equivalent 달러, Sol/Terra/Luna 환산은 그 다음이다. 계산은 reset_at 이 같은 쌍만. 퍼센트가 줄어들면 버린다. 1%p 전후는 미확정으로 둔다. 공식 한도라고 쓰지 말고 관측된 효율만 쓴다.#1820과 types.ts/config.ts 스플릿과 한 장에 섞지 않는다. 스플릿이 설정 키를 이미 옮긴 뒤에야 충돌이 보이면 리베이스하지 말고 닫고 다시 연다. 지금은 그 정도 아님. 라벨은 그대로 둔다. 프리뷰 배포가 아니다.이 댓글은 grok-bot이 작성했습니다
- 지금 할당량 관측 히스토리만 먼저 넣을지,
Closing in favor of #3376, which carries the remaining scope forward.
Thank you @Michael-Han0608 — the report on estimating effective quota capacity from observed usage and history was correct.
Current state.
src/codex/quota.tsstores only the newest snapshot per account and overwrites it, so there is no history to estimate from. That single fact is the shared blocker behind all three issues.Quota history, reset ordering, and automatic window activation are three views of one missing mechanism, so keeping them as three issues split the discussion without splitting the work. #3376 states the whole thing, names this issue, and credits you for the original analysis.
Please follow #3376; if the consolidation lost something you asked for, say so there and it will be added.
Area
Dashboard
What are you trying to accomplish?
I want OpenCodex to estimate how much effective Codex capacity a quota window represents by correlating two signals it already observes:
used_percent) and reset/window metadata.The main use case is detecting whether the amount of observed workload represented by one percentage point of Codex quota changes materially over time.
For example, if OpenCodex observes:
weekly quota: 42% -> 47%
observed usage during the same interval: 620 Codex-equivalent credits
it could estimate:
observed quota efficiency: 124 credits / percentage point
implied full-window capacity: ~12,400 credits
This should be presented as an observed estimate, not as OpenAI's official or contractual quota.
A derived API-equivalent value could also make the result easier to interpret:
estimated effective capacity
Codex-equivalent credits: ~12,400
API-equivalent value: ~$X
Optionally, the same capacity could be expressed as model-equivalent workload under a documented token mix, for example Sol-, Terra-, or Luna-equivalent usage.
The most useful output would be the trend rather than one isolated number:
window / observation estimated effective capacity
Aug 10 18.3k credits
Aug 11 18.0k credits
Aug 12 18.5k credits
Aug 13 17.9k credits
Aug 14 11.2k credits
This would let users distinguish ordinary subjective variation from a measurable change in observed quota efficiency.
What prevents this today?
OpenCodex already appears to have most of the required primitives, but they are not currently joined into one historical measurement.
On the usage side, OpenCodex already records timestamped request usage and model/token attribution, and the Usage work in #1058 and #1820 is extending calendar-day, model-level, cache, and estimated-cost accounting.
On the quota side, the Codex quota path already parses and stores values such as:
These values are already used for account-pool and quota-aware behavior.
The missing primitive appears to be bounded historical quota observations. The current quota cache is primarily a latest-state snapshot, so OpenCodex cannot reliably reconstruct:
quota at t0
quota at t1
usage observed between t0 and t1
after the fact.
As a result, users who want to investigate changes in Codex quota consumption currently have to manually combine local token logs with quota-percentage screenshots or external observations.
This type of manual analysis has recently been used in upstream Codex quota investigations (for example openai/codex#38728), which suggests that making the measurement reproducible locally would be useful.
What should OpenCodex do?
Add a bounded, privacy-safe quota-observation history and correlate it with authoritative local usage over matching intervals.
Conceptually:
quota observation A
timestamp = t0
weekly_used_percent = q0
reset_at = r
quota observation B
timestamp = t1
weekly_used_percent = q1
reset_at = r
local usage between t0 and t1
-> normalize by model/token type
-> derive observed workload C
Then calculate, where the observations are comparable:
delta quota = q1 - q0
observed quota efficiency
= C / delta_quota
implied full-window effective capacity
= C / (delta_quota / 100)
I would suggest using Codex-equivalent credits, or another stable normalized workload unit, as the canonical internal measure rather than raw tokens.
Raw tokens alone are misleading because input, cached input, output, and different Codex models can consume quota at very different rates.
If reliable pricing metadata is available, the UI may additionally derive:
Those should remain derived presentation values rather than the authoritative stored metric.
The implementation should also fail conservatively around discontinuities.
For example:
A small confidence/coverage indicator could make this explicit:
Estimated effective weekly capacity
12.4k credits
Observed quota delta: 8 pp
Observed interval: 19h
Coverage: OpenCodex traffic only
Confidence: medium
Example usage or interface
One possible Usage / Codex quota panel:
Codex effective capacity
Weekly window
────────────────────────────────────
Observed quota change 34% -> 41%
Observed workload 910 credits
Quota efficiency 130 credits / pp
Estimated full capacity ~13,000 credits
API-equivalent ~$X
vs previous estimate -28%
Confidence Medium
Based on traffic observed by OpenCodex.
Usage from other clients or shared agentic surfaces may reduce the estimate.
A historical view could show:
Date Credits / pp Implied capacity
Aug 17 181 18.1k
Aug 18 176 17.6k
Aug 19 184 18.4k
Aug 20 179 17.9k
Aug 21 116 11.6k
The first implementation does not need a complex chart. A compact table or trend indicator would already make the data useful.
Alternatives or workarounds
Today this can be approximated manually by:
This is cumbersome, difficult to reproduce, and loses historical quota observations unless the user records them separately.
Using raw token totals alone is also not sufficient because different models and token classes have different quota/credit weights.
Additional context
This appears complementary rather than duplicative with existing Usage work:
A possible composition would be:
[Feature]: add single-day/custom date filtering and daily model metrics to Usage #1058
-> reliable time-range selection
#1820
-> normalized model/token usage accounting
Codex quota observations
-> bounded quota history
this proposal
-> correlate both sides
-> estimate effective quota efficiency/capacity
The feature should explicitly avoid claiming to reveal OpenAI's internal quota formula or official subscription allowance.
There are several reasons the estimate can differ from the actual upstream allowance:
For that reason, names such as:
would be preferable to Actual quota.
The main value is detecting relative changes under a consistent measurement method, not asserting an undocumented absolute limit.
Checks