codex exec --json currently emits terminal failures as ThreadErrorEvent with only a message string in exec_events.rs. The app-server protocol already has structured CodexErrorInfo in shared.rs, including variants such as unauthorized, usageLimitExceeded, badRequest, serverOverloaded, and HTTP-status-bearing connection/stream variants.
Request: include the structured CodexErrorInfo (for example as error.codexErrorInfo, using the existing camelCase v2 shape) on turn.failed and top-level error JSONL events, preserving the human-readable message for display.
Why this matters: downstream harnesses need to distinguish auth, quota/rate, configuration, and transient provider failures without classifying English message text. Forwarding the existing structured discriminator would let callers use the JSON contract directly and remove message-substring fallback code.
Current observed shape on main: ThreadErrorEvent { message: String } in codex-rs/exec/src/exec_events.rs; CodexErrorInfo exists separately in codex-rs/app-server-protocol/src/protocol/v2/shared.rs but is not present in exec JSONL ThreadErrorEvent.
codex exec --json currently emits terminal failures as ThreadErrorEvent with only a message string in exec_events.rs. The app-server protocol already has structured CodexErrorInfo in shared.rs, including variants such as unauthorized, usageLimitExceeded, badRequest, serverOverloaded, and HTTP-status-bearing connection/stream variants.
Request: include the structured CodexErrorInfo (for example as error.codexErrorInfo, using the existing camelCase v2 shape) on turn.failed and top-level error JSONL events, preserving the human-readable message for display.
Why this matters: downstream harnesses need to distinguish auth, quota/rate, configuration, and transient provider failures without classifying English message text. Forwarding the existing structured discriminator would let callers use the JSON contract directly and remove message-substring fallback code.
Current observed shape on main: ThreadErrorEvent { message: String } in codex-rs/exec/src/exec_events.rs; CodexErrorInfo exists separately in codex-rs/app-server-protocol/src/protocol/v2/shared.rs but is not present in exec JSONL ThreadErrorEvent.