MCPcopy
hub / github.com/docker/docker-agent / executeOnUserInputHooks

Method executeOnUserInputHooks

pkg/runtime/hooks.go:477–486  ·  view source on GitHub ↗

executeOnUserInputHooks fires on_user_input when the runtime is about to wait for the user (tool confirmation, elicitation, max iterations, stream stopped). Resolves the agent itself so callsites in code paths without an agent handle (like the elicitation handler) stay short.

(ctx context.Context, sessionID, logContext string)

Source from the content-addressed store, hash-verified

475// stream stopped). Resolves the agent itself so callsites in code paths
476// without an agent handle (like the elicitation handler) stay short.
477func (r *LocalRuntime) executeOnUserInputHooks(ctx context.Context, sessionID, logContext string) {
478 a := r.CurrentAgent()
479 if a == nil {
480 return
481 }
482 slog.DebugContext(ctx, "Executing on-user-input hooks", "context", logContext)
483 r.dispatchHook(ctx, a, hooks.EventOnUserInput, &hooks.Input{
484 SessionID: sessionID,
485 }, nil)
486}
487
488// executeBeforeCompactionHooks fires before a session compaction. The
489// hook may veto the compaction (Decision: "block") or supply a custom

Callers 4

finalizeEventChannelMethod · 0.95
elicitationHandlerMethod · 0.95
enforceMaxIterationsMethod · 0.95
NotifyUserInputMethod · 0.80

Calls 2

CurrentAgentMethod · 0.95
dispatchHookMethod · 0.95

Tested by

no test coverage detected