Repository navigation
fix(codex): classify weekly-only rate limits on the backend path - #10466
brennanb2025 wants to merge 2 commits into
Conversation
…keep the mini meter The app-server RPC path already classifies Codex rate-limit windows by duration, but the backend HTTPS path (used for WSL) still assumed primary=5h / secondary=weekly by position. Weekly-only plans expose their sole 7-day quota as the primary window, so WSL users saw it mislabeled as a 5h session. Route the backend windows through the same duration classifier by reshaping them into the shared window snapshot, preserving the exact bucket duration the backend reports. Rename the classifier input types to be transport-neutral now that both paths share them. In the status bar, follow the weekly window when no session window exists so weekly-only plans keep their compact mini meter instead of losing it. 5h-only, 5h+weekly, and unknown-duration plans are unchanged on both paths.
…ckend-weekly-only-classify
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughCodex rate-limit handling now uses snapshot-based window types and derives window durations from backend data. Backend classification identifies weekly-only usage when the secondary window is absent and maps its duration and reset values. The status bar renders a mini meter using the weekly window when no session window exists. Tests cover backend weekly-only mapping and weekly meter rendering. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing as superseded: a merged PR already covers this change. Merged #11415 (b21f978) body: 'incorporates the remaining backend work from #10466'; it changed the same files (codex-fetcher.ts, codex-rate-limit-window-classification.ts, StatusBar.tsx) to run backend windows through the duration (Stale-PR cleanup 2026-10-20, approved by Brennan. Reopen if something here is still missing on main.) |
Summary
#10136 taught the app-server RPC path to classify Codex rate-limit windows by duration, but the backend HTTPS path — the one WSL uses — still assumed
primary = 5h/secondary = weeklyby position. Weekly-only plans (current Pro) expose their sole 7-day quota as the primary window, so WSL users saw it mislabeled as a5hsession.Verified against the live backend for a weekly-only Pro account:
Changes:
CodexRpc*→CodexRateLimitWindows*).p.session ?? p.weekly).5h-only, 5h+weekly, and unknown-duration plans are unchanged on both paths.
Context
Found while retesting #9969 on
v1.4.156-rc.0. The native (RPC) half of that mislabel is already fixed by #10136 — confirmed live, the Codex row went from5h · Resets in 6d 15htowk · Resets in 5d 19h. This PR closes the remaining WSL half.Note this does not fix #9969's reported symptom (limits resetting earlier than the displayed countdown) — that is upstream OpenAI reset behavior, not a client-side parsing bug.
Testing
typecheck:node+typecheck:webcleansrc/main/rate-limits/+src/renderer/src/components/status-bar/), incl. 3 new/updated test fileswk(not5h) plus its mini meter.