mirror of
https://github.com/openai/codex.git
synced 2026-11-18 22:20:48 +00:00
Centralize app-server turn error conversion (#62096)
## What changed Add a shared `From<ErrorEvent>` implementation for `TurnError` and reuse it in thread history, rollout projection, and live event handling. Preserve the existing field mappings and keep `additional_details` unset. Parameterize the compaction replay test by error code and recoverability, retaining the existing `server_error` case, and document retry expectations for WebSocket closes. GitOrigin-RevId: 3afcc23e9fdc314477febe6b4a4aeb680efafd5a
This commit is contained in:
@@ -451,6 +451,18 @@ pub struct TurnError {
|
||||
pub misalignment: Option<MisalignmentErrorDetails>,
|
||||
}
|
||||
|
||||
impl From<codex_protocol::protocol::ErrorEvent> for TurnError {
|
||||
fn from(error: codex_protocol::protocol::ErrorEvent) -> Self {
|
||||
let additional_details = None;
|
||||
Self {
|
||||
message: error.message,
|
||||
codex_error_info: error.codex_error_info.map(Into::into),
|
||||
additional_details,
|
||||
misalignment: error.misalignment.map(Into::into),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
|
||||
Reference in New Issue
Block a user