Codex.Events.TurnCompleted (Codex SDK v0.17.0)

Copy Markdown View Source

Final event for a turn, optionally carrying response, usage, and timing data.

App-server completions with status: "failed" carry terminal failure details in error. This is distinct from exec JSONL's TurnFailed event.

Summary

Types

t()

@type t() :: %Codex.Events.TurnCompleted{
  completed_at: integer() | nil,
  duration_ms: integer() | nil,
  error: map() | nil,
  final_response: Codex.Items.AgentMessage.t() | map() | nil,
  response_id: String.t() | nil,
  started_at: integer() | nil,
  status: String.t() | nil,
  thread_id: String.t() | nil,
  time_to_first_token_ms: integer() | nil,
  turn_id: String.t() | nil,
  usage: map() | nil
}