← Back to PRs

#19269: Fix Codex usage window label for weekly reset

by rmdmattingly open 2026-02-17 16:02 View on GitHub →
size: XS
## Summary - Fix Codex usage window label derivation to avoid labeling weekly windows as "Day". - Use 24h+ as Day only for sub-week windows and 7d+ (>=168h) as Week. - Add test coverage for label behavior. ## Details This updates `src/infra/provider-usage.fetch.codex.ts`: - Refactor window labeling into `describeWindowHours(windowSeconds)`. - Labels both `primary_window` and `secondary_window` with this helper. Touches: - `src/infra/provider-usage.fetch.codex.ts` - `src/infra/provider-usage.test.ts` Closes #19266 <!-- greptile_comment --> <h3>Greptile Summary</h3> Refactors Codex usage window labeling to correctly distinguish between daily and weekly rate limit windows. Previously, any window >=24 hours (including 168-hour weekly windows) was labeled "Day". The new `describeWindowHours` helper correctly labels windows <24h with hour counts, 24-167h as "Day", and >=168h as "Week". Test coverage verifies the fix. <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - Simple refactoring with clear logic and comprehensive test coverage. The fix correctly addresses the labeling issue without changing any business logic or external behavior - No files require special attention <sub>Last reviewed commit: ac32e1f</sub> <!-- greptile_other_comments_section --> <!-- /greptile_comment -->

Most Similar PRs