mirror of
https://github.com/openai/codex.git
synced 2026-09-05 15:18:41 +00:00
## Why Analytics need to associate subagent activity with the top-level turn that caused it, while avoiding a stale association when steering makes that origin ambiguous. ## What changed - Add `root_turn_id` to turn and tool-item analytics events. - Read the root from live turn metadata when each event is built, reporting `null` when the root is unknown or ambiguous. - Propagate the metadata through control-tool and code-mode completion facts so correlated and background tool events retain the correct root. ## Testing - Cover root IDs for top-level turns, subagent turns, correlated code-mode calls, and tool events emitted after turn completion. - Verify that queued and subsequent events report `null` after the live root is invalidated. GitOrigin-RevId: 42fd76541c3c716cec74787d47b50adb2d22e6d2