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

Method AgentConfigInfo

pkg/runtime/runtime.go:796–840  ·  view source on GitHub ↗

AgentConfigInfo returns the named agent's inspector dataset. It inspects the resolved agent and the retained config, reading live tool names only from already-started toolsets (never starting one), so it is safe to call for any agent whether or not it has run. Unknown agents yield the zero value, so

(ctx context.Context, agentName string)

Source from the content-addressed store, hash-verified

794// agent whether or not it has run. Unknown agents yield the zero value, so the
795// modal omits the corresponding sections.
796func (r *LocalRuntime) AgentConfigInfo(ctx context.Context, agentName string) AgentConfigInfo {
797 a, err := r.team.Agent(agentName)
798 if err != nil || a == nil {
799 return AgentConfigInfo{}
800 }
801
802 cfg, hasCfg := r.team.AgentConfig(agentName)
803
804 var subAgents []string
805 for _, sub := range a.SubAgents() {
806 if sub != nil {
807 subAgents = append(subAgents, sub.Name())
808 }
809 }
810
811 var handoffs []string
812 for _, h := range a.Handoffs() {
813 if h != nil {
814 handoffs = append(handoffs, h.Name())
815 }
816 }
817
818 var fallbacks []string
819 for _, p := range a.FallbackModels() {
820 if p != nil {
821 fallbacks = append(fallbacks, p.ID().String())
822 }
823 }
824
825 info := AgentConfigInfo{
826 SubAgents: uniqueNames(subAgents, true),
827 Handoffs: uniqueNames(handoffs, true),
828 Fallbacks: uniqueNames(fallbacks, false),
829 MaxIterations: a.MaxIterations(),
830 NumHistoryItems: a.NumHistoryItems(),
831 MaxConsecutiveToolCalls: a.MaxConsecutiveToolCalls(),
832 Options: agentOptionFlags(a, cfg, hasCfg),
833 Toolsets: toolsetDetails(ctx, a, cfg, hasCfg),
834 IsCurrent: r.agents != nil && r.agents.Name() == agentName,
835 }
836 if hasCfg {
837 info.Skills = configSkillNames(cfg)
838 }
839 return info
840}
841
842// agentOptionFlags lists the agent's enabled boolean options as stable,
843// hyphenated display names. AddDate/AddEnvironmentInfo/RedactSecrets read the

Callers 2

Calls 15

uniqueNamesFunction · 0.85
agentOptionFlagsFunction · 0.85
toolsetDetailsFunction · 0.85
configSkillNamesFunction · 0.85
AgentMethod · 0.80
AgentConfigMethod · 0.80
SubAgentsMethod · 0.80
HandoffsMethod · 0.80
FallbackModelsMethod · 0.80
MaxIterationsMethod · 0.80
NumHistoryItemsMethod · 0.80

Tested by 2