Skip to content

Fix monthly window label showing raw minutes instead of "Monthly"#2

Merged
stevejkang merged 1 commit into
mainfrom
fix/monthly-window-label
Jun 2, 2026
Merged

Fix monthly window label showing raw minutes instead of "Monthly"#2
stevejkang merged 1 commit into
mainfrom
fix/monthly-window-label

Conversation

@stevejkang

Copy link
Copy Markdown
Owner

Problem

When using monthly usage limits (non-Codex-subscription), the sidebar displays:

43200m      5%  resets in 29d 23h

The percentage and reset time are correct, but the label shows raw windowDurationMins value (43200) with an m suffix instead of a human-readable name.

Root Cause

formatWindowLabel in src/format.ts only handled four known durations (60/300/1440/10080) and fell through to `${windowDurationMins}m` for anything else. Codex RPC returns windowDurationMins=43200 for monthly limits (30 days), which was not mapped.

Fix

  • Add 43200 → "Monthly" case to formatWindowLabel
  • Reorder existing cases by ascending duration for readability
  • Improve fallback to convert unknown durations into human-readable day/hour units instead of dumping raw minutes

After

Monthly      5%  resets in 29d 23h

Tests

Added test cases for Monthly label, Hourly label, and human-readable fallback conversions. All 30 format tests pass.

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.
@stevejkang stevejkang merged commit 4866f18 into main Jun 2, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant