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

Method executeSessionStartHooks

pkg/runtime/hooks.go:146–151  ·  view source on GitHub ↗

executeSessionStartHooks fires session_start once at the top of RunStream and returns its AdditionalContext as transient system messages. The result is NOT persisted to the session: persisting would pollute the visible transcript and (because session_start fires after the user message has been added

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

Source from the content-addressed store, hash-verified

144// dispatch — there's nothing to "re-inject" because nothing was
145// persisted in the first place.
146func (r *LocalRuntime) executeSessionStartHooks(ctx context.Context, sess *session.Session, a *agent.Agent, events EventSink) []chat.Message {
147 return contextMessages(r.dispatchHook(ctx, a, hooks.EventSessionStart, &hooks.Input{
148 SessionID: sess.ID,
149 Source: "startup",
150 }, events))
151}
152
153// executeTurnStartHooks fires turn_start before each model call and
154// returns its AdditionalContext as transient system messages. Like

Callers 1

runStreamLoopMethod · 0.95

Calls 2

dispatchHookMethod · 0.95
contextMessagesFunction · 0.85

Tested by

no test coverage detected