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

Method SetValidated

pkg/runtime/agent_router.go:55–62  ·  view source on GitHub ↗

SetValidated checks that name exists in the team, then sets it as the current agent. Returns the team's lookup error unchanged so callers (e.g. the TUI's switch-agent flow) can propagate the same message.

(name string)

Source from the content-addressed store, hash-verified

53// current agent. Returns the team's lookup error unchanged so callers
54// (e.g. the TUI's switch-agent flow) can propagate the same message.
55func (r *agentRouter) SetValidated(name string) error {
56 if _, err := r.team.Agent(name); err != nil {
57 return err
58 }
59 r.Set(name)
60 slog.Debug("Switched current agent", "agent", name)
61 return nil
62}
63
64// Current returns the current agent. The returned agent is non-nil
65// because NewLocalRuntime validates the initial name and Set callers

Calls 3

SetMethod · 0.95
AgentMethod · 0.80
DebugMethod · 0.80