Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): a Claude account with no rate-limit data no longer stays unsupported #18624

Mergedfixfon(GitHub profile, opens in a new tab)merged 4 commits intomain fromrefs/pull/18624/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 21 additions and 9 deletions.

x
0 of 2 viewed, 2 left
17 additions and 8 deletionsapps/server/src/provider/claudeUsageLimits.test.tsModified
View file
@@ -86,14 +86,23 @@
).toEqual({ overageIncluded: "Fable" });
});
​
- it("reports API key and Bedrock accounts as unsupported", () => {
- expect(
- claudeUsageResponseToLimits({
- checkedAt,
- response: { rate_limits_available: false, rate_limits: null },
- }).limits,
- ).toEqual({ checkedAt, windows: [], unavailable: { reason: "unsupported" } });
- });
+ it.each([
+ { rateLimitsAvailable: false, reason: "unsupported" },
+ { rateLimitsAvailable: true, reason: "probeFailed" },
+ ])(
+ "reports null usage as $reason when availability is $rateLimitsAvailable",
+ ({ rateLimitsAvailable, reason }) => {
+ expect(
+ claudeUsageResponseToLimits({
+ checkedAt,
+ response: { rate_limits_available: rateLimitsAvailable, rate_limits: null },
+ }),
+ ).toEqual({
+ limits: { checkedAt, windows: [], unavailable: { reason } },
+ names: noNames,
+ });
+ },
+ );
​