Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): show limits for Claude setup-token accounts #24128

Openkoushikxd(GitHub profile, opens in a new tab)wants to merge 15 commits intomain fromrefs/pull/24128/headopened View on GitHub

Showing 7 changed files with 136 additions and 12 deletions (loading 4).

x
0 of 7 viewed, 7 left
2 additions and 0 deletionsapps/server/src/provider/ClaudeProvider.tsModified
View file
@@ -874,10 +874,12 @@
? yield* recordClaudeUsageResponse(scopedLimitNames, {
response: capabilities.usage,
checkedAt: usageCheckedAt,
+ tokenSource: capabilities.tokenSource,
: claudeUsageResponseToLimits({
response: capabilities.usage,
checkedAt: usageCheckedAt,
+ tokenSource: capabilities.tokenSource,
}).limits;
const resetCredits =
resolveResetCredits &&
82 additions and 0 deletionsapps/server/src/provider/claudeUsageLimits.test.tsModified
View file
@@ -84,6 +84,17 @@
).toEqual({ overageIncluded: "Fable" });
});
​
+ it("waits for a streamed reading from a setup token the probe cannot read, not from an API key", () => {
+ const response = { rate_limits_available: false, rate_limits: null };
+ expect(
+ claudeUsageResponseToLimits({ checkedAt, response, tokenSource: "CLAUDE_CODE_OAUTH_TOKEN" })
+ .limits.unavailable?.reason,
+ ).toBe("probeFailed");
+ expect(claudeUsageResponseToLimits({ checkedAt, response }).limits.unavailable?.reason).toBe(
+ "unsupported",
+ );