MCPcopy Create free account
hub / github.com/docker/docker-agent / prependAgentRef

Function prependAgentRef

cmd/root/agent_picker.go:887–889  ·  view source on GitHub ↗

prependAgentRef returns args with ref inserted as the leading positional argument. After an --agent-picker selection the remaining positional args are user messages, and the rest of the run pipeline expects args[0] to be the agent ref.

(ref string, args []string)

Source from the content-addressed store, hash-verified

885// are user messages, and the rest of the run pipeline expects args[0] to be
886// the agent ref.
887func prependAgentRef(ref string, args []string) []string {
888 return append([]string{ref}, args...)
889}
890
891// parseAgentPickerRefs splits a comma-separated list of agent refs, trims
892// whitespace, and drops empty entries. An empty/blank input or the

Callers 2

TestPrependAgentRefFunction · 0.85
runRunCommandMethod · 0.85

Calls

no outgoing calls

Tested by 1

TestPrependAgentRefFunction · 0.68