Skip to content

Track turn timing in ChatGPT telemetry#24144

Open
aibrahim-oai wants to merge 1 commit into
aibrahim/telemetry-thread-startfrom
aibrahim/telemetry-turn-timing
Open

Track turn timing in ChatGPT telemetry#24144
aibrahim-oai wants to merge 1 commit into
aibrahim/telemetry-thread-startfrom
aibrahim/telemetry-turn-timing

Conversation

@aibrahim-oai
Copy link
Copy Markdown
Collaborator

@aibrahim-oai aibrahim-oai commented May 22, 2026

Why

This is the turn-specific slice of the ChatGPT telemetry stack. We want per-turn timing that breaks total turn time into request-start delay, sampling time, and blocking tool critical path, while keeping approval wait attributable to the turn without mixing in app-server or thread startup costs.

What changed

  • extend TurnTimingState in codex-rs/core to accumulate request-start delay, sampling duration, and blocking-tool critical-path duration across a turn
  • emit a TurnTimingBreakdownFact at turn completion and attach it to codex_turn_event
  • roll review durations into approval_wait_duration_ms and derive finalize_duration_ms as the remainder after request start, sampling, and blocking tool time
  • add reducer and timing-state coverage for the new turn timing fields and approval roll-up

Verification

  • cargo check -p codex-analytics -p codex-app-server -p codex-core
  • just fix -p codex-analytics -p codex-core

@aibrahim-oai aibrahim-oai requested a review from a team as a code owner May 22, 2026 20:27
@aibrahim-oai
Copy link
Copy Markdown
Collaborator Author

aibrahim-oai commented May 22, 2026

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7c8290a3ff

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +772 to +774
self.services
.analytics_events_client
.track_turn_timing(TurnTimingBreakdownFact {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Track timing for interrupted turns too

This only enqueues TurnTimingBreakdownFact on the normal completion path, but interrupted turns go through handle_task_abort, which emits TurnAborted/TurnCompleted with status Interrupted without ever calling track_turn_timing. In the common case where a user interrupts a turn after a model request has started, codex_turn_event will still be emitted by the app-server path but all the new timing fields remain absent, so the telemetry slice is systematically missing interrupted-turn timing.

Useful? React with 👍 / 👎.

@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 7c8290a to e6cefb6 Compare May 22, 2026 22:28
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch 2 times, most recently from ee5e068 to 8933b1c Compare May 22, 2026 22:41
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 98a44ea to 06d0b8a Compare May 22, 2026 22:41
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from ce1b920 to b9ca2cf Compare May 22, 2026 22:45
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 06d0b8a to 9b3a2e3 Compare May 22, 2026 22:45
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 970b926 to a2b956b Compare May 22, 2026 22:55
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch 2 times, most recently from ca9d577 to c8eee6a Compare May 22, 2026 23:00
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 8c657ed to bdda087 Compare May 22, 2026 23:04
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from c8eee6a to 29314ca Compare May 22, 2026 23:04
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from bdda087 to 7424188 Compare May 22, 2026 23:05
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 29314ca to 015f13f Compare May 22, 2026 23:05
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 7424188 to 8713ba0 Compare May 22, 2026 23:25
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 015f13f to cd69d8a Compare May 22, 2026 23:25
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 8713ba0 to 0ebd75f Compare May 22, 2026 23:32
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from cd69d8a to 212bdfa Compare May 22, 2026 23:32
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 0ebd75f to 94d2891 Compare May 22, 2026 23:33
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch 2 times, most recently from 92815ef to fb48903 Compare May 22, 2026 23:51
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 81d4d94 to 33ac4ff Compare May 22, 2026 23:55
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch 2 times, most recently from 2d23da2 to 578811d Compare May 22, 2026 23:59
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 75c1117 to 52cfa94 Compare May 23, 2026 00:01
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch 2 times, most recently from 82eec7a to 4a21957 Compare May 23, 2026 00:06
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from cf508f7 to 5ffcaa1 Compare May 23, 2026 00:08
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 4a21957 to ad9ebd7 Compare May 23, 2026 00:08
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 5ffcaa1 to d562eb8 Compare May 23, 2026 00:16
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from ad9ebd7 to 1ce1075 Compare May 23, 2026 00:16
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from d562eb8 to cceadf2 Compare May 23, 2026 00:28
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 1ce1075 to 88ff700 Compare May 23, 2026 00:29
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from cceadf2 to 77d29c0 Compare May 23, 2026 00:38
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 88ff700 to 81ab8f6 Compare May 23, 2026 00:38
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-thread-start branch from 77d29c0 to 89ad405 Compare May 23, 2026 00:44
@aibrahim-oai aibrahim-oai force-pushed the aibrahim/telemetry-turn-timing branch from 81ab8f6 to 53aad70 Compare May 23, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant