Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): classify Codex 429 retry exhaustion as a usage limit #17501

MergedHylouis233(GitHub profile, opens in a new tab)merged 6 commits intomain fromrefs/pull/17501/headmerged by juliusmarminge View on GitHub

Showing 2 changed files with 127 additions and 2 deletions (loading 1).

x
0 of 2 viewed, 2 left
127 additions and 2 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -6779,12 +6779,27 @@
expectedClass: "usage_limit",
{ name: "retry", code: "usageLimitExceeded", notification: true, expectedClass: "usage_limit" },
+ {
+ name: "exhausted-429",
+ code: "responseTooManyFailedAttempts",
+ errorInfo: { responseTooManyFailedAttempts: { httpStatusCode: 429 } },
+ notification: false,
+ expectedClass: "usage_limit",
+ },
+ {
+ name: "exhausted-500",
+ code: "responseTooManyFailedAttempts",
+ errorInfo: { responseTooManyFailedAttempts: { httpStatusCode: 500 } },
+ notification: false,
+ expectedClass: "provider_error",
+ },
] as const)("classifies Codex terminal failures from $name evidence", (scenario) =>
Effect.scoped(
Effect.gen(function* () {
const nativeThreadId = `native-limit-${scenario.name}`;
const nativeTurnId = `turn-limit-${scenario.name}`;
const message = "Provider stopped this request.";
+ const errorInfo = "errorInfo" in scenario ? scenario.errorInfo : scenario.code;
const resetAt = "2033-05-19T07:20:00.000Z";
const snapshot = {
type: "emit_inbound" as const,
@@ -6855,7 +6870,7 @@