Repository navigation
Show Codex reset credit expiry - #5865
Conversation
|
Ready to review this PR? Stage has broken it down into 4 individual chapters for you:
Chapters generated by Stage for commit ea478dd on Jun 20, 2026 1:37am UTC. |
370d805 to
cdd0753
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📥 CommitsReviewing files that changed from the base of the PR and between cdd07533adbe52401f42b61934c4a9ecc9ec7e89 and ea478dd. 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (6)
📝 WalkthroughWalkthroughThe shared 🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (3)
src/main/rate-limits/codex-fetcher.ts (1)
143-146: ⚡ Quick winDocument the seconds-vs-milliseconds heuristic.
Line 145 uses a non-obvious cutoff (
10_000_000_000) that encodes a parsing contract; add a short “Why” comment so this logic is not accidentally changed.💡 Suggested inline clarification
function parseCreditTimestamp(value: number | string | null | undefined): number | null { if (typeof value === 'number' && Number.isFinite(value)) { + // Why: some payloads send Unix seconds while others send Unix milliseconds. return value < 10_000_000_000 ? value * 1000 : value }As per coding guidelines, "When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does."
Source: Coding guidelines
src/main/rate-limits/codex-fetcher.test.ts (1)
360-369: ⚡ Quick winAdd one numeric-epoch-string timestamp case to lock the widened contract.
These tests cover ISO timestamp strings, but not numeric-string epochs. Since mapping now accepts
number | string | null, add one case (e.g."1719326400"or"1719326400000") to prevent regressions in timestamp normalization.Also applies to: 383-393
src/renderer/src/components/status-bar/StatusBar.tsx (1)
1381-1385: ⚡ Quick winAdd a short
Why:note for the hide/show split of reset-credit UI.This path intentionally hides reset credits in
ProviderPanelwhile rendering them in the menu header. A one-line rationale here will prevent future “cleanup” from reintroducing duplicated copy.As per coding guidelines, “When writing or modifying code driven by a design doc or non-obvious constraint, add a comment explaining why the code behaves the way it does.”
Also applies to: 1683-1683
Source: Coding guidelines
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 25acbeaa-9651-40e7-a328-9442200255a4
📥 Commits
Reviewing files that changed from the base of the PR and between 5a85528 and e5c988775ee1ce9de14d82d647c1ac81a36d2338.
📒 Files selected for processing (6)
src/main/rate-limits/codex-fetcher.test.tssrc/main/rate-limits/codex-fetcher.tssrc/renderer/src/components/status-bar/StatusBar.tsxsrc/renderer/src/components/status-bar/tooltip.test.tssrc/renderer/src/components/status-bar/tooltip.tsxsrc/shared/rate-limit-types.ts
| {resetCreditExpiry ? ( | ||
| <div className="text-[11px] font-normal text-muted-foreground"> | ||
| {resetCreditExpiry} | ||
| </div> |
There was a problem hiding this comment.
Localize the expiry phrase before rendering it in the dropdown.
resetCreditExpiry is produced by formatResetCreditExpiry, which currently returns English phrases directly. That leaves Line 1458 untranslated while adjacent strings use translate(...).
Co-authored-by: Orca <[email protected]>
cdd0753 to
ea478dd
Compare
Co-authored-by: Orca <[email protected]>
Summary
Test Plan
Made with Orca 🐋