Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Claude usage meter follows live rate-limit updates below the warning threshold #28869

Openjuliusmarmingewants to merge 5 commits intomain fromrefs/pull/28869/headopened View on GitHub

Showing 2 changed files with 116 additions and 11 deletions.

x
0 of 2 viewed, 2 left
75 additions and 0 deletionsapps/server/src/provider/claudeUsageLimits.test.tsModified
View file
@@ -268,4 +268,79 @@
});
});
+​
+ it("maps every window in the unifiedWindows the CLI streams below the warning threshold", () => {
+ expect(
+ claudeRateLimitEventToUpdate(
+ {
+ status: "allowed",
+ resetsAt: 1_793_576_803,
+ rateLimitType: "five_hour",
+ isUsingOverage: false,
+ ...({
+ unifiedWindows: {
+ five_hour: { utilization: 0.15, resetsAt: 1_793_576_803 },
+ seven_day: { utilization: 0.31, resetsAt: 1_793_994_403 },
+ },
+ } as object),
+ },
+ noNames,
+ ),
+ ).toEqual({
+ windows: [
+ {
+ id: "five_hour",
+ kind: "session",
+ label: "Session",
+ usedPercent: 15,
+ windowDurationMins: 300,