fix: label Codex weekly usage window as "Week" instead of "Day" (#26267)
The secondary window label logic treated any window >= 24h as "Day", but Codex plans can have a weekly (604800s / 168h) quota window. The reset timer showed "resets 2d 4h" while the label said "Day", which was confusing. Now windows >= 168h are labeled "Week", >= 24h remain "Day", and shorter windows show the hour count. Closes #25812 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -65,7 +65,7 @@ export async function fetchCodexUsage(
|
||||
if (data.rate_limit?.secondary_window) {
|
||||
const sw = data.rate_limit.secondary_window;
|
||||
const windowHours = Math.round((sw.limit_window_seconds || 86400) / 3600);
|
||||
const label = windowHours >= 24 ? "Day" : `${windowHours}h`;
|
||||
const label = windowHours >= 168 ? "Week" : windowHours >= 24 ? "Day" : `${windowHours}h`;
|
||||
windows.push({
|
||||
label,
|
||||
usedPercent: clampPercent(sw.used_percent || 0),
|
||||
|
||||
Reference in New Issue
Block a user