executeSubagentStopHooks fires subagent_stop when a sub-agent (transferred task, background agent, skill sub-session) finishes. It always runs against the *parent* agent's executor: subagent_stop is by design observed by whoever spawned the sub-agent, so handlers configured on the parent see every c
(ctx context.Context, parent, child *session.Session, parentAgent *agent.Agent, subAgentName, response string)
| 630 | // configured on the parent see every child completion in one place |
| 631 | // without having to be replicated on each child. |
| 632 | func (r *LocalRuntime) executeSubagentStopHooks(ctx context.Context, parent, child *session.Session, parentAgent *agent.Agent, subAgentName, response string) { |
| 633 | r.dispatchHook(ctx, parentAgent, hooks.EventSubagentStop, &hooks.Input{ |
| 634 | SessionID: child.ID, |
| 635 | ParentSessionID: parent.ID, |
| 636 | AgentName: subAgentName, |
| 637 | StopResponse: response, |
| 638 | }, nil) |
| 639 | } |
no test coverage detected