MCPcopy Index your code
hub / github.com/docker/docker-agent / executeSubagentStopHooks

Method executeSubagentStopHooks

pkg/runtime/hooks.go:632–639  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

630// configured on the parent see every child completion in one place
631// without having to be replicated on each child.
632func (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}

Callers 2

runForwardingMethod · 0.95
runCollectingMethod · 0.95

Calls 1

dispatchHookMethod · 0.95

Tested by

no test coverage detected