Accept unknown Codex error variants in the app-server protocol (#49806)

## Why

New error variants should not prevent older clients from handling app-server errors.

## What changed

- Deserialize unknown `CodexErrorInfo` strings and objects as `Other` in Rust, while preserving known variants and the `"other"` serialization.
- Allow arbitrary strings and objects in the exported JSON schemas and TypeScript type.
- Update Python SDK generation and generated models to accept unknown error strings and object payloads.

## Testing

Add Rust tests for `"other"` round trips, unknown string and object fallbacks, known structured variants, and rejection of null, boolean, numeric, and array values.

GitOrigin-RevId: 40c17896019924b2ef7970ee2205ea0154d0d1b3
This commit is contained in:
Adam Perry @ OpenAI
2026-10-01 01:38:04 +00:00
committed by copyberry
parent e7798c9944
commit a5d56d8120
26 changed files with 303 additions and 69 deletions
@@ -55,8 +55,7 @@
"type": "object"
},
"CodexErrorInfo": {
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant.",
"oneOf": [
"anyOf": [
{
"enum": [
"contextWindowExceeded",
@@ -193,8 +192,15 @@
],
"title": "ActiveTurnNotSteerableCodexErrorInfo",
"type": "object"
},
{
"type": [
"string",
"object"
]
}
]
],
"description": "This translation layer make sure that we expose codex error code in camel case.\n\nWhen an upstream HTTP status is available (for example, from the Responses API or a provider), it is forwarded in `httpStatusCode` on the relevant `codexErrorInfo` variant."
},
"CollabAgentState": {
"properties": {