[app-server] update doc with codex error info (#6941)

Document new codex error info. Also fixed the name from
`codex_error_code` to `codex_error_info`.
This commit is contained in:
Celia Chen
2025-11-20 17:02:37 -08:00
committed by GitHub
parent 8e5f38c0f0
commit 7e2165f394
8 changed files with 50 additions and 24 deletions

View File

@@ -50,6 +50,9 @@ macro_rules! v2_enum_from_core {
}
/// This translation layer make sure that we expose codex error code in camel case.
///
/// When 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.
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
#[serde(rename_all = "camelCase")]
#[ts(export_to = "v2/")]
@@ -615,7 +618,7 @@ pub struct Turn {
#[error("{message}")]
pub struct TurnError {
pub message: String,
pub codex_error_code: Option<CodexErrorInfo>,
pub codex_error_info: Option<CodexErrorInfo>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, JsonSchema, TS)]
@@ -1253,7 +1256,7 @@ mod tests {
}
#[test]
fn codex_error_code_serializes_http_status_code_in_camel_case() {
fn codex_error_info_serializes_http_status_code_in_camel_case() {
let value = CodexErrorInfo::ResponseTooManyFailedAttempts {
http_status_code: Some(401),
};