codex/codex-rs/hooks
Abhinav e444aa99d7 Distinguish forked sessions in session-start hooks (#44349)
## Why

Forked threads reported `startup`, causing startup hooks to run again even when their context was inherited from the parent. Resuming with supplied history also reported `startup` instead of `resume`.

## What changed

- Add `fork` as a `SessionStart` source and expose it in the hook input schema.
- Report `fork` for histories with a fork parent and `resume` for supplied histories without one.
- Continue dispatching `SubagentStart` for spawned subagents with either fresh or forked context.

## Testing

Add regression coverage for fork hook matching without duplicate startup context, resume hooks with supplied history, and `SubagentStart` context injection for fresh and forked subagents.

GitOrigin-RevId: 5ac1ae4ab8adcbbbceb8cb0ffb9b32b6402c585b
History 2026-09-10 00:26:30 +00:00
..
schema/generated Distinguish forked sessions in session-start hooks (#44349) 2026-09-10 00:26:30 +00:00
src Distinguish forked sessions in session-start hooks (#44349) 2026-09-10 00:26:30 +00:00
BUILD.bazel build: run buildifier from just fmt (#28125) 2026-06-13 21:43:39 -07:00
Cargo.toml Run allowlisted executor plugin stop hooks (#40009) 2026-08-21 21:01:59 +00:00