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

Method executeStopHooks

pkg/runtime/hooks.go:238–245  ·  view source on GitHub ↗

executeStopHooks fires stop hooks when the model finishes responding, passing the final response content as stop_response. SystemMessage is surfaced as a Warning by [dispatchHook]. AgentName + LastUserMessage are populated so builtins like cache_response can key on the user's question and resolve th

(ctx context.Context, sess *session.Session, a *agent.Agent, responseContent string, events EventSink)

Source from the content-addressed store, hash-verified

236// are populated so builtins like cache_response can key on the user's
237// question and resolve the agent through the runtime closure.
238func (r *LocalRuntime) executeStopHooks(ctx context.Context, sess *session.Session, a *agent.Agent, responseContent string, events EventSink) {
239 r.dispatchHook(ctx, a, hooks.EventStop, &hooks.Input{
240 SessionID: sess.ID,
241 AgentName: a.Name(),
242 StopResponse: responseContent,
243 LastUserMessage: sess.GetLastUserMessageContent(),
244 }, events)
245}
246
247// notifyError fires both notification(level=error) and on_error in one
248// call. They're always emitted together (an error is always also a

Callers 3

runHarnessAgentMethod · 0.95
runTurnMethod · 0.95

Calls 3

dispatchHookMethod · 0.95
NameMethod · 0.65

Tested by

no test coverage detected