SIGN IN SIGN UP
openai / codex UNCLAIMED

Lightweight coding agent that runs in your terminal

0 0 109 Rust

hooks: use new session IDs instead of thread IDs for hooks, apply parent's session ID to subagents' hooks (#22268)

## Why

hook semantics treat `session_id` as shared across a root session and
its subagents. Codex hooks were still emitting the current thread ID,
which made spawned agents look like independent sessions and made it
harder for hook integrations to correlate work across a root thread and
its spawned helpers

This change makes hooks use Codex's existing shared session identity so
hook `session_id` matches the root-thread session across spawned
subagents.

## What Changed

- switch hook payloads to use the existing shared session identity from
core instead of the current thread ID
- cover all hook surfaces that expose `session_id`, including
`SessionStart`, tool hooks, compact hooks, prompt-submit hooks, stop
hooks, and legacy after-agent dispatch
A
Andrei Eternal committed
fbfbfe5fc57a9f232b09866ae0eae6e792377074
Parent: e2eb7c3
Committed by GitHub <noreply@github.com> on 5/13/2026, 2:05:10 AM