fix: zero expired codex windows in backend, use /usage API as single frontend data source

This commit is contained in:
Ethan0x0000
2026-03-16 19:46:07 +08:00
parent aa5846b282
commit 7fde9ebbc2
6 changed files with 61 additions and 394 deletions

View File

@@ -1042,6 +1042,11 @@ func buildCodexUsageProgressFromExtra(extra map[string]any, window string, now t
}
}
// 窗口已过期resetAt 在 now 之前)→ 额度已重置,归零
if progress.ResetsAt != nil && !now.Before(*progress.ResetsAt) {
progress.Utilization = 0
}
return progress
}