File tree Expand file tree Collapse file tree
packages/effect-codex-app-server Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,8 +199,12 @@ function applyCodex0151DefinitionCompatibility(
199199 definitionName : string ,
200200 definitionSchema : Schema . Json ,
201201) : Schema . Json {
202+ const isThreadResponse =
203+ exportName === "V2ThreadReadResponse" ||
204+ exportName === "V2ThreadResumeResponse" ||
205+ exportName === "V2ThreadRollbackResponse" ;
202206 if (
203- exportName !== "V2ThreadResumeResponse" ||
207+ ! isThreadResponse ||
204208 definitionName !== "CodexErrorInfo" ||
205209 typeof definitionSchema !== "object"
206210 ) {
Original file line number Diff line number Diff line change @@ -16851,6 +16851,7 @@ export type V2ThreadReadResponse__CodexErrorInfo =
1685116851 | "badRequest"
1685216852 | "threadRollbackFailed"
1685316853 | "sandboxError"
16854+ | "rateLimitExceeded"
1685416855 | "other"
1685516856 | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } }
1685616857 | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } }
@@ -16874,6 +16875,7 @@ export const V2ThreadReadResponse__CodexErrorInfo = Schema.Union(
1687416875 "badRequest",
1687516876 "threadRollbackFailed",
1687616877 "sandboxError",
16878+ "rateLimitExceeded",
1687716879 "other",
1687816880 ]),
1687916881 Schema.Struct({
@@ -17484,6 +17486,7 @@ export type V2ThreadRollbackResponse__CodexErrorInfo =
1748417486 | "badRequest"
1748517487 | "threadRollbackFailed"
1748617488 | "sandboxError"
17489+ | "rateLimitExceeded"
1748717490 | "other"
1748817491 | { readonly httpConnectionFailed: { readonly httpStatusCode?: number | null } }
1748917492 | { readonly responseStreamConnectionFailed: { readonly httpStatusCode?: number | null } }
@@ -17507,6 +17510,7 @@ export const V2ThreadRollbackResponse__CodexErrorInfo = Schema.Union(
1750717510 "badRequest",
1750817511 "threadRollbackFailed",
1750917512 "sandboxError",
17513+ "rateLimitExceeded",
1751017514 "other",
1751117515 ]),
1751217516 Schema.Struct({
Original file line number Diff line number Diff line change @@ -74,11 +74,16 @@ it("accepts Codex 0.150 multi-agent values", () => {
7474 assert . equal ( Schema . is ( CodexSchema . V2ThreadResumeResponse ) ( resumeResponse ) , true ) ;
7575} ) ;
7676
77- it ( "accepts Codex rate limit errors when resuming a thread" , ( ) => {
78- assert . equal (
79- Schema . is ( CodexSchema . V2ThreadResumeResponse__CodexErrorInfo ) ( "rateLimitExceeded" ) ,
80- true ,
81- ) ;
77+ it ( "accepts Codex rate limit errors for thread responses" , ( ) => {
78+ const schemas = [
79+ CodexSchema . V2ThreadReadResponse__CodexErrorInfo ,
80+ CodexSchema . V2ThreadResumeResponse__CodexErrorInfo ,
81+ CodexSchema . V2ThreadRollbackResponse__CodexErrorInfo ,
82+ ] ;
83+
84+ for ( const schema of schemas ) {
85+ assert . equal ( Schema . is ( schema ) ( "rateLimitExceeded" ) , true ) ;
86+ }
8287} ) ;
8388
8489it ( "accepts Codex 0.150 account plan values" , ( ) => {
You can’t perform that action at this time.
0 commit comments