Skip to content

[codex-analytics] emit internally started turn events - #27392

Merged
marksteinbrick-oai merged 1 commit into
mainfrom
mark.steinbrick/fix-subagent-turn-events
Jun 10, 2026
Merged

[codex-analytics] emit internally started turn events#27392
marksteinbrick-oai merged 1 commit into
mainfrom
mark.steinbrick/fix-subagent-turn-events

Conversation

@marksteinbrick-oai

@marksteinbrick-oai marksteinbrick-oai commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Why

Currently, the analytics reducer omits codex_turn_event for internally started subagent turns

  • It uses TurnState.connection_id to select app-server client and runtime metadata
  • turn/start sets this field for client-started turns, while internal subagent turns bypass that path
  • Spawned child threads inherit the correct connection, but turn emission does not use thread state

What Changed

  • Keeps explicit TurnState.connection_id authoritative for client-started turns
  • Falls back to the matching thread’s inherited connection when the turn connection is absent
  • Preserves completeness gates, event schema, and post-emission state removal
  • Extends subagent lifecycle test coverage

Verification

  • just test -p codex-analytics (71 tests passed)
  • just fix -p codex-analytics
  • just fmt

@marksteinbrick-oai
marksteinbrick-oai marked this pull request as ready for review June 10, 2026 21:57
@marksteinbrick-oai
marksteinbrick-oai merged commit b39f943 into main Jun 10, 2026
31 checks passed
@marksteinbrick-oai
marksteinbrick-oai deleted the mark.steinbrick/fix-subagent-turn-events branch June 10, 2026 22:35
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 10, 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