fix(ai): normalize Z.AI weekly quota window

This commit is contained in:
can1357
2026-06-28 18:26:54 +02:00
parent 544013a24c
commit 4e77d591a4
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -158,9 +158,9 @@ function buildZaiWindow(parsed: ZaiUsageLimitItem): UsageWindow {
durationMs = count * MONTH_MS;
break;
case 6:
id = `${count}w`;
label = count === 1 ? "Weekly" : formatCountedUnit(count, "Week");
durationMs = count * WEEK_MS;
id = "1w";
label = "Weekly";
durationMs = WEEK_MS;
break;
default:
id = parsed.unit !== undefined ? `${count}u${parsed.unit}` : "quota";
+1 -1
View File
@@ -51,7 +51,7 @@ describe("zai usage provider", () => {
],
},
{ type: "TOKENS_LIMIT", percentage: 82, nextResetTime: 1782656863894, unit: 3, number: 5 },
{ type: "TOKENS_LIMIT", percentage: 38, nextResetTime: 1783165208993, unit: 6, number: 1 },
{ type: "TOKENS_LIMIT", percentage: 38, nextResetTime: 1783165208993, unit: 6, number: 7 },
],
},
}),