You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add agent hooks and the subagent_stop, pre_compact, and session_end events #168
Some checks need to read files or run commands before deciding, such as reviewing a diff before a turn ends. An agent handler runs a read-only child agent for these checks. The other lifecycle events let hooks guide compaction and clean up after a session.
Acceptance criteria
An agent handler runs a child engine with the hook's prompt and an optional definition (use = "<agent>"). By default, it has read-class tools, a read-only sandbox, 20 turns, no hooks, denied asks, and a 10 min timeout. Its final message is parsed like a prompt reply.
subagent_stop fires when a child agent ends a turn and honors continue.
pre_compact fires before summarization with the trigger and instructions, and its context is added to the summary instructions.
session_end fires on exit, /clear, and session roll. All its hooks share a 5 s budget.
Tests cover each event's payload and honored fields, as well as an agent hook's verdict.
Notes
Depends on #159. This issue establishes the agent execution core that #134 describes and #136's subagents reuse, so #136 depends on this issue, not the other way round. The core runs a child as an in-process engine with its own cwd and messages, the parent's policy and mode, and the parent frontend's approval channel.
Activity
docs: track planned work in GitHub issues (#188)