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

Method RunAgent

pkg/runtime/agent_delegation.go:483–493  ·  view source on GitHub ↗

RunAgent implements agenttool.Runner. It starts a sub-agent synchronously and blocks until completion or cancellation. Background tasks run with tools pre-approved because there is no user present to respond to interactive approval prompts during async execution. This is a deliberate design trade-o

(ctx context.Context, params agenttool.RunParams)

Source from the content-addressed store, hash-verified

481// runtime supports per-session permission scoping rather than a single
482// shared ToolsApproved flag.
483func (r *LocalRuntime) RunAgent(ctx context.Context, params agenttool.RunParams) *agenttool.RunResult {
484 return r.runCollecting(ctx, params.ParentSession, SubSessionConfig{
485 Task: params.Task,
486 ExpectedOutput: params.ExpectedOutput,
487 AgentName: params.AgentName,
488 Title: "Background agent task",
489 ToolsApproved: true,
490 NonInteractive: true,
491 PinAgent: true,
492 }, params.OnContent)
493}
494
495func (r *LocalRuntime) handleTaskTransfer(ctx context.Context, sess *session.Session, toolCall tools.ToolCall, evts EventSink) (*tools.ToolCallResult, error) {
496 var params struct {

Calls 1

runCollectingMethod · 0.95