Abhinav
d661ab70ed
Add SubagentStart hook ( #22782 )
...
# What
`SubagentStart` runs once when Codex creates a thread-spawned subagent,
before that child sends its first model request. Thread-spawned
subagents use `SubagentStart` instead of the normal root-agent
`SessionStart` hook.
Configured handlers match on the subagent `agent_type`, using the same
value passed to `spawn_agent`. When no agent type is specified, Codex
uses the default agent type.
Hook input includes the normal session-start fields plus:
- `agent_id`: the child thread id.
- `agent_type`: the resolved subagent type.
`SubagentStart` may return `hookSpecificOutput.additionalContext`. That
context is added to the child conversation before the first model
request.
# Lifecycle Scope
Only thread-spawned subagents run `SubagentStart`.
Internal/system subagents such as Review, Compact, MemoryConsolidation,
and Other do not run normal `SessionStart` hooks and do not run
`SubagentStart`. This avoids exposing synthetic matcher labels for
internal implementation paths.
Also the `SessionStart` hook no longer fires for subagents, this matches
behavior with other coding agents' implementation
# Stack
1. This PR: add `SubagentStart`.
2. #22873 : add `SubagentStop`.
3. #22882 : add subagent identity to normal hook inputs.
History
..
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-04-20 15:37:31 -07:00
2026-04-20 15:37:31 -07:00
2026-05-09 13:58:10 -03:00
2026-05-09 13:58:10 -03:00
2026-04-24 11:14:13 +02:00
2026-03-28 11:23:07 -06:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-04-27 10:07:15 -07:00
2026-05-12 10:43:17 -03:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-04-28 12:52:25 -03:00
2026-04-27 03:43:53 +00:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-03-28 11:23:07 -06:00
2026-04-24 11:14:13 +02:00
2026-04-24 11:14:13 +02:00
2026-04-10 14:05:47 -07:00
2026-04-10 14:05:47 -07:00
2026-04-10 14:05:47 -07:00
2026-04-30 11:34:34 -07:00
2026-04-24 21:16:45 -07:00
2026-03-28 11:23:07 -06:00
2026-04-01 22:00:27 -06:00
2026-04-01 22:00:27 -06:00
2026-04-01 22:00:27 -06:00
2026-04-01 22:00:27 -06:00
2026-04-27 18:48:57 -07:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-05-13 21:23:19 +00:00
2026-04-28 12:52:25 -03:00
2026-05-13 21:23:19 +00:00
2026-03-28 11:23:07 -06:00
2026-04-28 09:24:29 -07:00
2026-03-28 11:23:07 -06:00
2026-04-20 15:37:31 -07:00
2026-05-12 10:43:17 -03:00
2026-05-11 10:49:19 -07:00
2026-05-11 10:49:19 -07:00
2026-05-18 11:28:53 -07:00
2026-05-11 10:49:19 -07:00
2026-05-11 10:49:19 -07:00
2026-05-18 11:28:53 -07:00
2026-04-24 11:14:13 +02:00
2026-04-24 11:14:13 +02:00
2026-05-09 13:58:10 -03:00
2026-04-24 11:14:13 +02:00
2026-05-09 13:58:10 -03:00
2026-04-10 14:05:47 -07:00
2026-04-10 14:05:47 -07:00
2026-04-10 14:05:47 -07:00
2026-04-10 14:05:47 -07:00
2026-05-19 12:45:08 -07:00
2026-04-10 14:05:47 -07:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-05-01 14:48:22 -07:00
2026-03-28 11:23:07 -06:00
2026-04-24 21:16:45 -07:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-04-24 11:14:13 +02:00
2026-05-12 10:43:17 -03:00
2026-04-15 15:34:25 +01:00
2026-04-15 15:34:25 +01:00
2026-04-28 12:52:25 -03:00
2026-04-20 21:52:30 +00:00
2026-05-12 10:43:17 -03:00
2026-04-28 12:52:25 -03:00
2026-05-12 10:43:17 -03:00
2026-04-10 14:05:47 -07:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-05-12 10:43:17 -03:00
2026-04-19 14:01:58 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-04-28 14:34:10 -03:00
2026-04-28 14:34:10 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-04-28 14:22:39 -07:00
2026-04-28 12:52:25 -03:00
2026-04-30 10:25:07 -07:00
2026-05-01 11:26:29 -07:00
2026-04-28 14:22:39 -07:00
2026-04-10 14:05:47 -07:00
2026-04-10 14:05:47 -07:00
2026-04-24 11:14:13 +02:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-05-12 10:43:17 -03:00
2026-03-28 11:23:07 -06:00
2026-05-04 08:58:07 -07:00
2026-04-24 11:14:13 +02:00
2026-05-11 11:34:52 -07:00
2026-04-10 14:05:47 -07:00
2026-05-14 20:51:08 -07:00
2026-05-14 20:51:08 -07:00
2026-04-09 18:10:38 -03:00
2026-05-12 10:43:17 -03:00
2026-04-16 09:01:45 -07:00
2026-04-24 11:14:13 +02:00
2026-05-12 10:43:17 -03:00
2026-04-24 21:16:45 -07:00
2026-04-30 22:42:07 -07:00
2026-04-16 09:00:16 -07:00
2026-04-12 15:42:09 -07:00
2026-05-12 10:43:17 -03:00
2026-05-13 15:33:27 +00:00
2026-05-13 15:33:27 +00:00
2026-05-13 15:33:27 +00:00
2026-05-19 11:22:00 -07:00
2026-05-08 08:03:11 -07:00
2026-04-20 17:46:11 -07:00
2026-04-20 17:46:11 -07:00
2026-05-19 11:22:00 -07:00
2026-04-24 11:14:13 +02:00
2026-05-12 10:43:17 -03:00
2026-05-13 15:33:27 +00:00
2026-05-13 15:33:27 +00:00
2026-05-13 15:33:27 +00:00
2026-05-19 11:22:00 -07:00
2026-05-18 11:32:02 -07:00
2026-04-24 11:14:13 +02:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-04-24 11:14:13 +02:00
2026-03-28 11:23:07 -06:00
2026-03-28 11:23:07 -06:00
2026-04-10 14:05:47 -07:00
2026-03-28 11:23:07 -06:00
2026-04-20 05:51:47 +00:00
2026-04-20 05:51:47 +00:00
2026-04-20 05:51:47 +00:00
2026-04-20 05:51:47 +00:00
2026-04-20 05:51:47 +00:00