Repository navigation
[Bug] Codex Auth: ~30d primary-only account shows stale weekly with simultaneous display for weekly + 30 days (#315 remaining) #382
Description
Client or integration
OpenCodex dashboard
Area
Authentication and account pool
Summary
Team Codex Auth 계정 중 WHAM primary_window만 있고 limit_window_seconds=2628000(약 30.4일)인 계정이, 대시보드 Codex Auth에서 주간과 30일을 **같은 reset_at**으로 동시에 표시합니다.
기대: WHAM에 ~30d primary만 있으면 monthlyPercent만 노출되고 weeklyPercent는 없어야 합니다.
실제: /api/codex-auth/accounts와 UI에 weeklyPercent + monthlyPercent가 함께 남습니다.
관련: #315 (closed), #317 (parseUsageQuota의 monthly 분류 수정은 반영됨). 이번 건은 그 잔여/회귀입니다.
Reproduction
- OpenCodex
2.7.35에서 Codex Auth pool에 Team 계정들을 둔다. - 그중 WHAM
primary_window.limit_window_seconds=2628000,secondary_window=null, tertiary 없음인 계정을 확인한다. - 해당 계정으로 Codex 요청을 1회 이상 보내거나, 예전에 primary→weekly로 캐시된 상태가 있는 경우 Dashboard → Codex Auth /
GET /api/codex-auth/accounts?refresh=1을 연다. - 같은
reset_at으로 주간과 30일이 함께 표시된다.
실측 (alias / email / account id 마스킹):
| account | plan | WHAM primary | secondary/tertiary | fresh parseUsageQuota 기대 |
API/UI after refresh |
|---|---|---|---|---|---|
monthly-A |
team | 100%, 2628000 (~30.4d), reset 1787401330 |
null | { monthlyPercent: 100 } only |
weeklyPercent: 100 and monthlyPercent: 100, same reset |
weekly-A |
team | 100%, 604800 (7d) |
null | weekly only | weekly only (정상) |
weekly-B |
team | 80%, 604800 (7d) |
null | weekly only | weekly only (정상) |
WHAM 원본 (monthly-A, 민감정보 제외):
{
"plan_type": "team",
"rate_limit": {
"primary_window": {
"used_percent": 100,
"limit_window_seconds": 2628000,
"reset_after_seconds": 2531353,
"reset_at": 1787401330
},
"secondary_window": null
}
}GET /api/codex-auth/accounts?refresh=1 (monthly-A):
{
"quota": {
"weeklyPercent": 100,
"monthlyPercent": 100,
"weeklyResetAt": 1787401330,
"monthlyResetAt": 1787401330,
"resetCredits": 0
}
}Version
2.7.35 (@bitkyc08/opencodex)
Operating system
WSL2 / Linux (kernel 6.6.x)
Provider and model
OpenAI Codex / ChatGPT Team (plan_type: team). 특정 모델 무관 — Codex Auth quota 표시 문제.
Logs or error output
원인 추정 (설치된 2.7.35 소스 기준):
src/codex/quota.tsparseUsageQuota()— fix(codex): classify monthly WHAM windows #317 이후 primarylimit_window_seconds >= 28d면 monthly로 분류. 위 WHAM이면 fresh parse는 monthly만 나와야 함.src/server/responses.ts— upstreamx-codex-primary-used-percent를 duration/window-minutes무시하고 항상 weekly로updateAccountQuota에 넣음. (x-codex-*-window-minutes는 passthrough만 하고 분류에 미사용)src/codex/quota.tsupdateAccountQuota()— merge-only라 이후 WHAM refresh가 monthly만 줘도 기존weeklyPercent를 clear하지 않음.- Dashboard는
weeklyPercent/monthlyPercent가 있으면 각각codexAuth.weekly/codexAuth.monthly(KO: 주간 / 30일)를 렌더할 뿐.
결과적으로 ~30d primary 하나가 **주간 줄(헤더/스탈) + 30일 줄(WHAM)**로 중복 표시되고, 리셋 시각이 동일해진다.
Screenshots and supporting files
N/A (재현은 API JSON으로 확인). 필요하면 마스킹 스크린샷 추가 가능.
Redacted configuration
{
"surface": "OpenCodex dashboard #codex-auth",
"auth": "Codex account pool (Team)",
"note": "aliases, emails, tokens, ChatGPT account ids omitted"
}Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Related
- Relates to [Bug] Codex Auth: primary_window가 월간(≈30d)인데 UI/API가 주간(Week)으로 표시됨 #315
- Follow-up after fix(codex): classify monthly WHAM windows #317 (
fix(codex): classify monthly WHAM windows)
Suggested fix
- 헤더 경로도
window-minutes(또는 WHAM과 동일 ≥28d 규칙)로 primary를 weekly/monthly 분류 - WHAM/헤더 갱신 시 이번에 없는 window 필드는 clear (또는 quota replace)
- 회귀 테스트: ~30d primary-only + 이전 stale weekly → refresh 후 weekly 제거,
weeklyResetAt/monthlyResetAt동일 중복 표시 방지
Activity
[-][Bug] Codex Auth: ~30d primary-only 계정에 stale weekly가 남아 주간+30일이 동시 표시됨 (#315 잔여)[/-][+][Bug] Codex Auth: ~30d primary-only account shows stale weekly with simultaneous display for weekly + 30 days (#315 remaining)[/+]github-actions commentedon Jul 24, 2026
English translation (original: ko)
Client or integration
OpenCodex dashboard
Area
Authentication and account pool
Summary
Among the Team Codex Auth accounts, accounts with only WHAM
primary_windowandlimit_window_seconds=2628000(about 30.4 days) are displaying both weekly and 30 days simultaneously on the dashboard Codex Auth with the samereset_at.Expected: If there is only ~30d primary in WHAM, only
monthlyPercentshould be exposed andweeklyPercentshould not exist.Actual: Both
weeklyPercent+monthlyPercentremain in the/api/codex-auth/accountsand UI.Related: #315 (closed), #317 (the modification of monthly classification in
parseUsageQuotahas been reflected). This case is that remaining/regression.Reproduction
2.7.35.primary_window.limit_window_seconds=2628000,secondary_window=null, and no tertiary.GET /api/codex-auth/accounts?refresh=1.reset_at.Measured (masked alias / email / account id):
parseUsageQuotaexpectedmonthly-A2628000(~30.4d), reset1787401330{ monthlyPercent: 100 }onlyweeklyPercent: 100andmonthlyPercent: 100, same resetweekly-A604800(7d)weekly-B604800(7d)WHAM original (
monthly-A, excluding sensitive information):{ "plan_type": "team", "rate_limit": { "primary_window": { "used_percent": 100, "limit_window_seconds": 2628000, "reset_after_seconds": 2531353, "reset_at": 1787401330 }, "secondary_window": null } }GET /api/codex-auth/accounts?refresh=1(monthly-A):{ "quota": { "weeklyPercent": 100, "monthlyPercent": 100, "weeklyResetAt": 1787401330, "monthlyResetAt": 1787401330, "resetCredits": 0 } }Version
2.7.35 (
@bitkyc08/opencodex)Operating system
WSL2 / Linux (kernel 6.6.x)
Provider and model
OpenAI Codex / ChatGPT Team (
plan_type: team). Independent of specific models — Codex Auth quota display issue.Logs or error output
Estimated cause (based on installed 2.7.35 sources):
src/codex/quota.tsparseUsageQuota()— After fix(codex): classify monthly WHAM windows #317, ifprimary limit_window_seconds >= 28d, classify as monthly. In the above WHAM, fresh parse should only show monthly.src/server/responses.ts— Always puts upstreamx-codex-primary-used-percentintoupdateAccountQuotaas weekly, ignoring duration/window-minutes. (x-codex-*-window-minutesonly passthroughs and is not used for classification)src/codex/quota.tsupdateAccountQuota()— Since it’s merge-only, even if a refreshed WHAM gives only monthly, it does not clear the existingweeklyPercent.codexAuth.weekly/codexAuth.monthly(KO: weekly / 30 days) if bothweeklyPercent/monthlyPercentexist.As a result, a ~30d primary is displayed as both a weekly line (header/stale) + a 30-day line (WHAM), with the same reset timestamp.
Screenshots and supporting files
N/A (Reproduction can be confirmed through API JSON). If needed, masked screenshots can be added.
Redacted configuration
{ "surface": "OpenCodex dashboard #codex-auth", "auth": "Codex account pool (Team)", "note": "aliases, emails, tokens, ChatGPT account ids omitted" }Checks
Related
fix(codex): classify monthly WHAM windows)Suggested fix
window-minutes(or the same ≥28d rule as WHAM).weeklyResetAt/monthlyResetAtbeing the same.fix(codex): clear stale weekly quota on WHAM/header refresh (#382) (#390
lidge-jun commentedon Jul 24, 2026
Fixed by #390 (merged to dev as ac49d13). The stale weekly + simultaneous weekly/30-day display for ~30d primary-only Codex Auth accounts is resolved: header/WHAM refreshes now preserve existing windows and only clear weekly when the account is genuinely primary-only (see quota.ts merge/precedence semantics + regression tests in rate-limit-reset-credits.test.ts). Reopen if you still see both windows on the same reset_at after updating.
fix(codex,gui): restore the plan and ticket badges on the main accoun…
fix(codex,gui): restore the plan and ticket badges on the main accoun…
fix(codex): clear stale weekly quota on WHAM/header refresh (lidge-ju…
fix(codex,gui): restore the plan and ticket badges on the main accoun…