Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): restore auto resume for wrapped Claude gateway rate limits #17778

Mergedtzachbon(GitHub profile, opens in a new tab)merged 1 commit intomain fromrefs/pull/17778/headmerged by Yash-Singh1(GitHub profile, opens in a new tab) View on GitHub

Showing 2 changed files with 89 additions and 3 deletions.

x
0 of 2 viewed, 2 left
59 additions and 1 deletionapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -3017,7 +3017,65 @@
- it.effect.each([429, 401, 529])(
+ it.effect.each([
+ { status: 503, cooldown: "4m 6s", seconds: 246 },
+ { status: 503, cooldown: "1h 2m 3s", seconds: 3723 },
+ { status: 503, cooldown: "7s", seconds: 7 },
+ { status: 503, cooldown: "0s", seconds: 0 },
+ { status: 503, cooldown: "unknown", seconds: 0 },
+ { status: 503, cooldown: "999999999999999999999999h", seconds: 0 },
+ { status: 503, cooldown: "4m 6s", seconds: 0, errorType: "overloaded_error" },
+ { status: 401, cooldown: "4m 6s", seconds: 0 },
+ ])("recovers wrapped gateway limits with status $status and cooldown $cooldown", (input) =>
+ Effect.gen(function* () {
+ const harness = yield* makeWakeHarness;
+ const now = yield* DateTime.now;
+ yield* harness.runtime.startTurn(
+ makeClaudeTestTurnInput({
+ threadId: harness.threadId,
+ providerThread: harness.providerThread,
+ now,
+ attemptId: RunAttemptId.make("attempt-gateway-limit"),
+ text: "Continue.",
+ attachments: [],
+ }),
+ );
+ yield* Queue.offerAll(harness.sdkMessages, [
+ makeAssistantErrorFrame({