Files
Adam Perry @ OpenAI 1b4ea8b3be Add structured telemetry for response retries (#38452)
## What changed

- Emit trace-safe `codex.retry` events immediately before retry delays, including the attempt number, selected delay, retry layer, and operation.
- Cover HTTP requests, sampling streams, remote compaction, and sampling connection recovery. Track connection-recovery attempts separately from the stream retry budget.
- Add integration coverage for retry timing and terminal behavior across HTTP, SSE, WebSocket, and remote-compaction paths, including rate limits, overloads, connection failures, and `Retry-After` inputs.

GitOrigin-RevId: dae38900a0579cf8ba062c3f3d90ee61851c1c99
2026-08-13 23:13:37 +00:00
..

codex-client

Higher-level request policy layered on codex-http-client without any Codex/OpenAI API awareness.

  • Provides retry utilities (RetryPolicy, RetryOn, run_with_retry, backoff) that callers plug into for unary and streaming calls.
  • Supplies the sse_stream helper to turn byte streams into raw SSE data: frames with idle timeouts and surfaced stream errors.
  • Defines the request telemetry callback used by higher-level clients.
  • Re-exports the low-level HTTP types temporarily so consumers can migrate to codex-http-client incrementally.