Skip to content

Emit turn cost telemetry for ChatGPT sessions - #41944

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6ae3f8df729fad52984a0c6efafd8c96c7214e55
Sep 1, 2026
Merged

Emit turn cost telemetry for ChatGPT sessions#41944
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6ae3f8df729fad52984a0c6efafd8c96c7214e55

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 1, 2026

Copy link
Copy Markdown

Emit turn cost telemetry for ChatGPT sessions

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.

## 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
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6ae3f8df729fad52984a0c6efafd8c96c7214e55 branch from 080df96 to e39ab0c Compare September 1, 2026 00:31
@copyberry
copyberry Bot merged commit e39ab0c into main Sep 1, 2026
26 of 32 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6ae3f8df729fad52984a0c6efafd8c96c7214e55 branch September 1, 2026 00:32
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants