Skip to content

Forward structured CodexErrorInfo in codex exec JSONL error events #22570

@jarodclark-4

Description

@jarodclark-4

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestexecIssues related to the `codex exec` subcommand

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions