mirror of
https://github.com/openai/codex.git
synced 2026-09-20 12:47:38 +00:00
## Why Per-socket metrics label resends after reconnect as initial requests, obscuring why full input was sent. Client telemetry can preserve that reason across reconnect failures and turn boundaries. ## What changed - Add `codex.websocket.continuation` to count `response.create` send attempts, including failed sends, with `mode`, `reason`, and `phase` tags. - Distinguish incremental continuations, fresh requests, restored history, closed connections, and other full-input sends. Track warmup and generation separately. - Preserve the first continuation reset reason until the next send and identify resumed or forked history. - Allow session telemetry to use a `MetricsClient` supplied through thread extensions and document the counter's semantics. ## Testing Add metric assertions for incremental reuse, warmup, changed requests, account switches, reconnects, and resumed or forked history. Add a unit test for preserving reset reasons across repeated resets and turn boundaries. GitOrigin-RevId: 29324f5e9d5677e0c6068f89b2256a92a5a0d157