AddToolWarning records a warning generated while loading or starting toolsets. Warnings represent real failures the user should know about (a remote MCP server returning 4xx, an MCP binary missing, ...). Recoveries from a previous failure are intentionally not surfaced: the OAuth dialog and subseque
(msg string)
| 533 | // subsequent tool use already make a successful start obvious, so emitting |
| 534 | // a "now available" notification only adds noise. |
| 535 | func (a *Agent) AddToolWarning(msg string) { |
| 536 | if msg == "" { |
| 537 | return |
| 538 | } |
| 539 | a.warningsMu.Lock() |
| 540 | defer a.warningsMu.Unlock() |
| 541 | a.pendingWarnings = append(a.pendingWarnings, msg) |
| 542 | } |
| 543 | |
| 544 | // DrainWarnings returns pending warnings and clears them. |
| 545 | func (a *Agent) DrainWarnings() []string { |