mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:50:52 +00:00
## Why Hosted workers keep the host's session source, so hook dispatch can mistake them for root sessions and run `SessionStart` and `Stop` on worker turns. ## What changed Recognize host-managed workers by their inherited session ID and dispatch `SubagentStart` and `SubagentStop` for them. Resolve the parent transcript for `SubagentStop` using the immediate parent thread ID when available. ## Testing Add a regression test that verifies a hosted worker runs only the subagent lifecycle hooks, receives start-hook context, and reports its own transcript and final message in the stop hook. GitOrigin-RevId: 272d29d275120a1b020b1a00a0db2e00402ebe06