Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): usage-limited threads on a pooling proxy now resume when the pool recovers #17866

Closedcoderdevang(GitHub profile, opens in a new tab)wants to merge 7 commits intomain fromrefs/pull/17866/headopened View on GitHub

Showing 13 changed files with 174 additions and 3 deletions (loading 10).

x
0 of 13 viewed, 13 left
149 additions and 0 deletionsapps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.tsModified
View file
@@ -2437,6 +2437,7 @@
toolUseId: string,
) => Effect.Effect<boolean, ClaudeAdapterV2.ClaudeAgentSdkQueryRunnerError>;
readonly environment?: NodeJS.ProcessEnv;
+ readonly usageLimitResetFallback?: Effect.Effect<string | null>;
readonly subagentLaunchToolUseId?: string;
readonly nativeSessionId?: string;
readonly settings?: ClaudeSettings;
@@ -2485,6 +2486,9 @@
instanceId: ClaudeAdapterV2.CLAUDE_DEFAULT_INSTANCE_ID,
settings: options?.settings ?? DEFAULT_CLAUDE_SETTINGS,
environment: options?.environment ?? {},
+ ...(options?.usageLimitResetFallback
+ ? { usageLimitResetFallback: () => options.usageLimitResetFallback! }
+ : {}),
attachmentsDir,
fileSystem,
path: yield* Path.Path,
@@ -4230,6 +4234,151 @@
+ describe("usage-limit reset fallback", () => {
+ // The shape a pooling proxy produces: a bare 429 with no rate_limit_event.
+ const runLimitedTurn = (options: {
+ readonly fallback: Effect.Effect<string | null>;
+ readonly rateLimitResetsAt?: number;
+ }) =>