Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(claude): report usage limits on retried turns #10549

MergedStiensWout(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/10549/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 180 additions and 2 deletions.

x
0 of 2 viewed, 2 left
173 additions and 1 deletionapps/server/src/provider/Layers/ClaudeAdapter.test.tsModified
View file
@@ -2367,6 +2367,139 @@
+ const usageLimitMessage =
+ "Claude usage limit reached. Send the message again once the limit resets.";
+ const genericApiErrorMessage = "Claude gave up after repeated API errors.";
+ const rateLimitAssistant = {
+ type: "assistant",
+ session_id: "sdk-session-limit",
+ uuid: "assistant-limit",
+ parent_tool_use_id: null,
+ error: "rate_limit",
+ message: {
+ id: "assistant-message-limit",
+ model: "<synthetic>",
+ content: [{ type: "text", text: "You've hit your session limit" }],
+ },
+ };
+ const rateLimitResult = {
+ type: "result",
+ subtype: "success",
+ is_error: true,
+ terminal_reason: "api_error",
+ session_id: "sdk-session-limit",
+ uuid: "result-limit",
+ };
+​
+ it.effect.each([
+ {