feat(usage): track GPT-5.3-Codex-Spark quota windows

Extract Spark rate limit windows from the Codex usage response and expose
them as spark_session/spark_weekly quotas, reusing the existing prefix
mechanism. Map codex quota types to readable dashboard labels.

Fixes #3431
This commit is contained in:
DarRahman
2026-08-27 17:52:45 +07:00
committed by decolua
parent 0532f00d84
commit 40eed18688
3 changed files with 67 additions and 1 deletions

View File

@@ -379,8 +379,17 @@ export function parseQuotaData(provider, data) {
case "codex":
if (data.quotas) {
Object.entries(data.quotas).forEach(([quotaType, quota]) => {
let displayName = quotaType;
if (quotaType === "spark_session") displayName = "Spark (5h)";
else if (quotaType === "spark_weekly") displayName = "Spark (Weekly)";
else if (quotaType === "session") displayName = "5h";
else if (quotaType === "weekly") displayName = "Weekly";
else if (quotaType === "review_session") displayName = "Review (5h)";
else if (quotaType === "review_weekly") displayName = "Review (Weekly)";
normalizedQuotas.push({
name: quotaType,
name: displayName,
quotaType,
used: quota.used || 0,
total: quota.total || 0,
remaining: quota.remaining,