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

Method ResolveSession

pkg/runtime/agent_router.go:76–83  ·  view source on GitHub ↗

ResolveSession returns the agent for sess: when sess pins a specific agent (e.g. background agent tasks), that agent is returned directly instead of reading the shared current-agent field; otherwise Current is returned.

(sess *session.Session)

Source from the content-addressed store, hash-verified

74// instead of reading the shared current-agent field; otherwise Current
75// is returned.
76func (r *agentRouter) ResolveSession(sess *session.Session) *agent.Agent {
77 if sess.AgentName != "" {
78 if a, err := r.team.Agent(sess.AgentName); err == nil {
79 return a
80 }
81 }
82 return r.Current()
83}

Calls 2

CurrentMethod · 0.95
AgentMethod · 0.80