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

Method emitAgentWarnings

pkg/runtime/loop.go:1188–1195  ·  view source on GitHub ↗

emitAgentWarnings drains and emits any pending toolset warnings as persistent TUI notifications. Failures ("start failed", "list failed") are surfaced so the user can act on them; recoveries are intentionally not emitted — "X is now available" reads as a spurious warning right after the user complet

(a *agent.Agent, events EventSink)

Source from the content-addressed store, hash-verified

1186// after the user completes an OAuth dance, and adds no signal for other
1187// recoveries either.
1188func (r *LocalRuntime) emitAgentWarnings(a *agent.Agent, events EventSink) {
1189 warnings := a.DrainWarnings()
1190 if len(warnings) == 0 {
1191 return
1192 }
1193 slog.Warn("Tool setup partially failed; continuing", "agent", a.Name(), "warnings", warnings)
1194 events.Emit(Warning(formatToolWarning(a, warnings), a.Name()))
1195}
1196
1197func formatToolWarning(a *agent.Agent, warnings []string) string {
1198 var builder strings.Builder

Callers 6

runStreamLoopMethod · 0.95
reprobeMethod · 0.95
EmitStartupInfoMethod · 0.95

Calls 6

WarningFunction · 0.85
formatToolWarningFunction · 0.85
DrainWarningsMethod · 0.80
WarnMethod · 0.80
NameMethod · 0.65
EmitMethod · 0.65