Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): Claude limits show from streamed events when the usage probe fails #49552

Openwillbedust(GitHub profile, opens in a new tab)wants to merge 3 commits intomain fromrefs/pull/49552/headopened View on GitHub

Showing 7 changed files with 130 additions and 11 deletions (loading 4).

x
0 of 7 viewed, 7 left
75 additions and 0 deletionsapps/server/src/provider/claudeUsageLimits.test.tsModified
View file
@@ -150,4 +150,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,