Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep a gateway's Claude reset time on a direct 429 #25438

Mergedtyler-b4innova(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/25438/headmerged by maria-rcks View on GitHub

Showing 2 changed files with 90 additions and 19 deletions.

x
0 of 2 viewed, 2 left
53 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -6402,6 +6402,59 @@
+ it.effect.each([
+ { cooldown: " (reset after 1h2m3s)", seconds: 3723 },
+ { cooldown: " (reset after 4m 6s) (last error: rate limited)", seconds: 246 },
+ { cooldown: "", seconds: 0 },
+ ])("keeps a gateway's reset on a direct 429 with 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-direct-gateway-limit"),
+ text: "Continue.",
+ attachments: [],
+ }),
+ );
+ // An API-key session reports a gateway 429 only as text, with no rate_limit_info.
+ const result = `API Error: Request rejected (429) · All credentials for model claude-opus-5-5 are cooling down${input.cooldown}`;
+ yield* Queue.offerAll(harness.sdkMessages, [
+ makeAssistantErrorFrame({
+ uuid: "00000000-0000-4000-8000-000000000654",
+ error: "rate_limit",
+ text: result,
+ }),