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

Method executeUserFollowupSubmitHooks

pkg/runtime/hooks.go:593–605  ·  view source on GitHub ↗

executeUserFollowupSubmitHooks fires user_followup_submit each time the runtime dequeues a follow-up message at the end of a turn and starts a fresh turn for it. Follow-ups are user messages queued for end-of-turn processing (the FollowUp API / queue), distinct from mid-turn steering. It mirrors use

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

Source from the content-addressed store, hash-verified

591// returned as a transient system message that the caller threads into
592// the follow-up turn only — never persisted.
593func (r *LocalRuntime) executeUserFollowupSubmitHooks(ctx context.Context, sess *session.Session, a *agent.Agent, prompt string, events EventSink) (stop bool, message string, contextMsgs []chat.Message) {
594 result := r.dispatchHook(ctx, a, hooks.EventUserFollowupSubmit, &hooks.Input{
595 SessionID: sess.ID,
596 Prompt: prompt,
597 }, events)
598 if result == nil {
599 return false, "", nil
600 }
601 if !result.Allowed {
602 return true, result.Message, nil
603 }
604 return false, "", contextMessages(result)
605}
606
607// executePreCompactHooks fires pre_compact just before compaction.
608// The trigger reason ("manual", "auto", "overflow", "tool_overflow")

Callers 1

runTurnMethod · 0.95

Calls 2

dispatchHookMethod · 0.95
contextMessagesFunction · 0.85

Tested by

no test coverage detected