Fix monthly window label showing raw minutes instead of "Monthly"#2
Merged
Conversation
Codex RPC returns windowDurationMins=43200 for monthly usage limits, but formatWindowLabel had no case for it. The fallback dumped the raw number with an "m" suffix, producing "43200m" in the sidebar. Add the Monthly (43200) mapping and reorder existing cases by ascending duration. Improve the fallback to convert unknown durations into human-readable day/hour units instead of raw minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When using monthly usage limits (non-Codex-subscription), the sidebar displays:
The percentage and reset time are correct, but the label shows raw
windowDurationMinsvalue (43200) with anmsuffix instead of a human-readable name.Root Cause
formatWindowLabelinsrc/format.tsonly handled four known durations (60/300/1440/10080) and fell through to`${windowDurationMins}m`for anything else. Codex RPC returnswindowDurationMins=43200for monthly limits (30 days), which was not mapped.Fix
43200 → "Monthly"case toformatWindowLabelAfter
Tests
Added test cases for Monthly label, Hourly label, and human-readable fallback conversions. All 30 format tests pass.