fix(status-bar): sync Codex rate-limit chip with remaining reset time (#8378)#9004
Conversation
Prefer formatResetDuration when resetsAt is known so the status-bar chip matches the usage popup countdown instead of the fixed window size.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe status bar now uses a reset-aware formatter for session, weekly, and monthly rate-limit chips. The formatter displays remaining duration when a reset timestamp exists, falls back to the fixed window size when it does not, and reports expired windows as “now.” Tests cover formatter behavior and status-bar rendering with reset timestamps. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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 |
Agent handoffFixes: #8378 Reproduce (before / regression after merge)Branch with kits: Full issue kit (summary + re-run + file links): see the Agent handoff — reproduction kit comment on #8378. Writeup: https://github.com/stablyai/orca/blob/nwparker/bug-repro-handoffs/docs/bug-reproductions/8378.md This PRAlready includes Description / Evidence / ELI5 / User-regression-tradeoffs in the body. Review that section first; re-run the issue's |
Summary
Status-bar rate-limit chips now show remaining time until reset when
resetsAtis known (e.g.2h 33m), matching the usage popup countdown. Fixed window labels (5h,wk) remain only as a fallback when no reset timestamp is available.Fixes #8378
Description
Codex (and other providers) exposed a mismatch between:
formatResetCountdown→ “Resets in 2h 33m”formatWindowLabel(windowMinutes)→ “5h” (full window size)Both surfaces now share remaining-time semantics via
formatResetDurationwhenresetsAtis present. Chip copy stays compact (2h 33m); the popup still prefixes with “Resets in …”.Evidence
windowMinutes: 300andresetsAt = now + 2h33mrenders42% used 2h 33m, not5h.formatResetDurationand popup =Resets in 2h 33mfor the same delta.resetsAt: nullstill yields5h/wk/30d.ELI5
The little number in the bottom bar said “this window is 5 hours long,” while the popup said “you have 2 hours 33 minutes left.” They now both talk about time left.
User-regression-tradeoffs
Ideally zero: users already expected remaining time (popup was correct; chip was wrong).
Possible mild surprise only if someone relied on the chip as a static window-size badge (
5h/wk); that fallback still appears when the API omitsresetsAt. Chip labels can be slightly longer (2h 33mvs5h).Screenshots
No new UI chrome — text change on existing status-bar usage chips (remaining duration instead of fixed window size when reset time is known).
Testing
vitestfor rate-limit label / status-bar segment / tooltip suitespnpm lint(not run full suite)pnpm typecheckpnpm test(full suite)pnpm buildAI Review Report
Checked that:
formatResetDuration/formatResetCountdownfrom the same remaining-ms input.resetsAtstill uses fixed window labels.Security Audit
Display-only change: formats existing numeric timestamps for UI. No new IPC, auth, secrets, command execution, or path handling.
Notes
Countdown updates on re-render (same as the popup), not a live 1s ticker. Session/weekly/monthly chips all prefer remaining time when
resetsAtis set.