mirror of
https://github.com/openai/codex.git
synced 2026-09-03 14:59:03 +00:00
## Why App-server clients need the explanation and steering instruction returned with a misalignment policy violation to offer a user-confirmed continuation. Missing or incomplete details must continue to behave as a terminal block. ## What changed - Parse optional misalignment classification, explanation, and steering details from streamed and HTTP Responses errors and propagate them through core errors. - Include the details in live app-server `error` and `turn/completed` payloads and export the corresponding protocol schemas and TypeScript types. - Keep explanations and steering messages out of serialized rollout events and redact them from debug output. - Document how clients can resume with `turn/start` after user confirmation. ## Testing - Cover streamed, HTTP, and WebSocket-wrapped errors, including malformed and classification-only details. - Verify live app-server notifications expose resumable details without writing the explanation or steering message to the rollout. GitOrigin-RevId: 329258a444c2cd91d0c57ab1720830b33ddcfac5
255 lines
6.7 KiB
JSON
Generated
255 lines
6.7 KiB
JSON
Generated
{
|
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
"definitions": {
|
|
"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": [
|
|
{
|
|
"enum": [
|
|
"contextWindowExceeded",
|
|
"sessionBudgetExceeded",
|
|
"usageLimitExceeded",
|
|
"rateLimitExceeded",
|
|
"serverOverloaded",
|
|
"cyberPolicy",
|
|
"misalignmentPolicyViolation",
|
|
"internalServerError",
|
|
"unauthorized",
|
|
"badRequest",
|
|
"threadRollbackFailed",
|
|
"sandboxError",
|
|
"other"
|
|
],
|
|
"type": "string"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"properties": {
|
|
"httpConnectionFailed": {
|
|
"properties": {
|
|
"httpStatusCode": {
|
|
"format": "uint16",
|
|
"minimum": 0.0,
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"httpConnectionFailed"
|
|
],
|
|
"title": "HttpConnectionFailedCodexErrorInfo",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"description": "Failed to connect to the response SSE stream.",
|
|
"properties": {
|
|
"responseStreamConnectionFailed": {
|
|
"properties": {
|
|
"httpStatusCode": {
|
|
"format": "uint16",
|
|
"minimum": 0.0,
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"responseStreamConnectionFailed"
|
|
],
|
|
"title": "ResponseStreamConnectionFailedCodexErrorInfo",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"description": "The response SSE stream disconnected in the middle of a turn before completion.",
|
|
"properties": {
|
|
"responseStreamDisconnected": {
|
|
"properties": {
|
|
"httpStatusCode": {
|
|
"format": "uint16",
|
|
"minimum": 0.0,
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"responseStreamDisconnected"
|
|
],
|
|
"title": "ResponseStreamDisconnectedCodexErrorInfo",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"description": "Reached the retry limit for responses.",
|
|
"properties": {
|
|
"responseTooManyFailedAttempts": {
|
|
"properties": {
|
|
"httpStatusCode": {
|
|
"format": "uint16",
|
|
"minimum": 0.0,
|
|
"type": [
|
|
"integer",
|
|
"null"
|
|
]
|
|
}
|
|
},
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"responseTooManyFailedAttempts"
|
|
],
|
|
"title": "ResponseTooManyFailedAttemptsCodexErrorInfo",
|
|
"type": "object"
|
|
},
|
|
{
|
|
"additionalProperties": false,
|
|
"description": "Returned when `turn/start` or `turn/steer` is submitted while the current active turn cannot accept same-turn steering, for example `/review` or manual `/compact`.",
|
|
"properties": {
|
|
"activeTurnNotSteerable": {
|
|
"properties": {
|
|
"turnKind": {
|
|
"$ref": "#/definitions/NonSteerableTurnKind"
|
|
}
|
|
},
|
|
"required": [
|
|
"turnKind"
|
|
],
|
|
"type": "object"
|
|
}
|
|
},
|
|
"required": [
|
|
"activeTurnNotSteerable"
|
|
],
|
|
"title": "ActiveTurnNotSteerableCodexErrorInfo",
|
|
"type": "object"
|
|
}
|
|
]
|
|
},
|
|
"MisalignmentErrorDetails": {
|
|
"properties": {
|
|
"detailedExplanation": {
|
|
"description": "A substantive localized explanation is required before offering continuation.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"errorType": {
|
|
"description": "Open-ended classification; clients must accept categories added by Responses.",
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"steer": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/MisalignmentSteer"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"description": "Instruction to submit as the next turn's user input if continuation is confirmed."
|
|
}
|
|
},
|
|
"type": "object"
|
|
},
|
|
"MisalignmentSteer": {
|
|
"properties": {
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
},
|
|
"required": [
|
|
"message"
|
|
],
|
|
"type": "object"
|
|
},
|
|
"NonSteerableTurnKind": {
|
|
"enum": [
|
|
"review",
|
|
"compact"
|
|
],
|
|
"type": "string"
|
|
},
|
|
"TurnError": {
|
|
"properties": {
|
|
"additionalDetails": {
|
|
"default": null,
|
|
"type": [
|
|
"string",
|
|
"null"
|
|
]
|
|
},
|
|
"codexErrorInfo": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/CodexErrorInfo"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
]
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
},
|
|
"misalignment": {
|
|
"anyOf": [
|
|
{
|
|
"$ref": "#/definitions/MisalignmentErrorDetails"
|
|
},
|
|
{
|
|
"type": "null"
|
|
}
|
|
],
|
|
"default": null,
|
|
"description": "Optional public explanation and continuation instruction for a misalignment block."
|
|
}
|
|
},
|
|
"required": [
|
|
"message"
|
|
],
|
|
"type": "object"
|
|
}
|
|
},
|
|
"properties": {
|
|
"error": {
|
|
"$ref": "#/definitions/TurnError"
|
|
},
|
|
"threadId": {
|
|
"type": "string"
|
|
},
|
|
"turnId": {
|
|
"type": "string"
|
|
},
|
|
"willRetry": {
|
|
"type": "boolean"
|
|
}
|
|
},
|
|
"required": [
|
|
"error",
|
|
"threadId",
|
|
"turnId",
|
|
"willRetry"
|
|
],
|
|
"title": "ErrorNotification",
|
|
"type": "object"
|
|
} |