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
This commit is contained in:
Adam Perry @ OpenAI authored and copyberry committed 2026-08-13 23:13:37 +00:00
1 parent 813dc5f08d
commit 1b4ea8b3be
8 files changed
+1779 -2

No files matched your search

+1
View File
@@ -11,6 +11,7 @@ futures = { workspace = true }
http = { workspace = true }
rand = { workspace = true }
tokio = { workspace = true, features = ["macros", "rt", "time", "sync"] }
tracing = { workspace = true }
[lints]
workspace = true