Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): accept rate limit errors on thread resume #8897

MergednateEc(GitHub profile, opens in a new tab)merged 3 commits intomain fromrefs/pull/8897/headmerged by t3dotgg(GitHub profile, opens in a new tab) View on GitHub

Showing 3 changed files with 80 additions and 1 deletion.

x
0 of 3 viewed, 3 left
36 additions and 1 deletionpackages/effect-codex-app-server/scripts/generate.tsModified
View file
@@ -194,6 +194,40 @@
​
+function applyCodex0151DefinitionCompatibility(
+ exportName: string,
+ definitionName: string,
+ definitionSchema: Schema.Json,
+): Schema.Json {
+ const isThreadResponse =
+ exportName === "V2ThreadReadResponse" ||
+ exportName === "V2ThreadResumeResponse" ||
+ exportName === "V2ThreadRollbackResponse";
+ if (
+ !isThreadResponse ||
+ definitionName !== "CodexErrorInfo" ||
+ typeof definitionSchema !== "object"
+ ) {
+ return definitionSchema;
+ }
+​
+ const schema = definitionSchema as {
+ readonly oneOf?: ReadonlyArray<{ readonly enum?: ReadonlyArray<string> }>;
+ };
+ const [firstVariant, ...remainingVariants] = schema.oneOf ?? [];
+ if (!firstVariant?.enum || firstVariant.enum.includes("rateLimitExceeded")) {
+ return definitionSchema;
+ }
+​