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

Method CurrentAgentModel

pkg/app/app.go:406–418  ·  view source on GitHub ↗

CurrentAgentModel returns the model ID for the current agent. Returns the tracked model from AgentInfoEvent, or falls back to session overrides. Returns empty string if no model information is available (fail-open scenario).

(ctx context.Context)

Source from the content-addressed store, hash-verified

404// Returns the tracked model from AgentInfoEvent, or falls back to session overrides.
405// Returns empty string if no model information is available (fail-open scenario).
406func (a *App) CurrentAgentModel(ctx context.Context) string {
407 if a.currentAgentModel != "" {
408 return a.currentAgentModel
409 }
410 // Fallback to session overrides
411 if a.session != nil && a.session.AgentModelOverrides != nil {
412 agentName := a.runtime.CurrentAgentName(ctx)
413 if modelRef, ok := a.session.AgentModelOverrides[agentName]; ok {
414 return modelRef
415 }
416 }
417 return ""
418}
419
420// TrackCurrentAgentModel updates the tracked model ID for the current agent.
421// This is called when AgentInfoEvent is received from the runtime.

Callers

nothing calls this directly

Calls 1

CurrentAgentNameMethod · 0.65

Tested by

no test coverage detected