Skip to content

[codex-analytics] add grouped session id to runtime events#24655

Merged
marksteinbrick-oai merged 2 commits into
mainfrom
mark.steinbrick/populate-runtime-analytics-session-id
May 26, 2026
Merged

[codex-analytics] add grouped session id to runtime events#24655
marksteinbrick-oai merged 2 commits into
mainfrom
mark.steinbrick/populate-runtime-analytics-session-id

Conversation

@marksteinbrick-oai

@marksteinbrick-oai marksteinbrick-oai commented May 26, 2026

Copy link
Copy Markdown
Contributor

Why

  • Runtime analytics events report thread_id, which identifies the individual thread emitting an event
  • They don't report session_id, which identifies the shared session for a root thread and its subagent threads
  • Emitting both identifiers allows analytics to group related activity

What Changed

  • Adds session_id to relevant analytics events (thread_initalized, turn, turn_steer, compaction, guardian_review)
  • Tracks each thread's session ID in the analytics reducer so subsequent thread scoped events emit the same value
  • Carries the shared session ID through subagent initialization

Verification

  • just test -p codex-analytics validates event payloads and subagent session grouping.
  • Focused codex-app-server tests validate session IDs for thread, turn, and steer events.
  • Focused codex-core tests validate root and subagent session ID propagation.

Comment thread codex-rs/analytics/src/reducer.rs Outdated
@marksteinbrick-oai marksteinbrick-oai marked this pull request as ready for review May 26, 2026 23:27
@marksteinbrick-oai marksteinbrick-oai requested a review from a team as a code owner May 26, 2026 23:27
@marksteinbrick-oai marksteinbrick-oai merged commit 4875217 into main May 26, 2026
31 checks passed
@marksteinbrick-oai marksteinbrick-oai deleted the mark.steinbrick/populate-runtime-analytics-session-id branch May 26, 2026 23:38
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 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.

2 participants