Files
codex/codex-rs/backend-client
xli-oai e39ab0c185 Emit turn cost telemetry for ChatGPT sessions (#41944)
## What changed

- Query workspace-visible turn estimates for ChatGPT-authenticated sessions through the appropriate Codex or ChatGPT endpoint.
- Track completed response IDs and emit `codex.turn.cost_microusd` only when the estimate is nonnegative, visible, and covers every observed response.
- Keep error response bodies out of turn-cost worker logs.

## Testing

- Cover both endpoint styles, nullable estimates, settlement validation, exact micro-USD conversion, and response-ID tracking.
- Add an app-server integration test that verifies a settled ChatGPT turn reaches the OTLP metrics exporter with its turn, conversation, and auth-mode attributes.

GitOrigin-RevId: 6ae3f8df729fad52984a0c6efafd8c96c7214e55
2026-09-01 00:30:55 +00:00
..
2025-09-30 10:10:33 +00:00