emitToolsChanged is the callback registered on MCP toolsets. It re-reads the current agent's full tool list and pushes a ToolsetInfo event.
()
| 1412 | // emitToolsChanged is the callback registered on MCP toolsets. It re-reads |
| 1413 | // the current agent's full tool list and pushes a ToolsetInfo event. |
| 1414 | func (r *LocalRuntime) emitToolsChanged() { |
| 1415 | if r.onToolsChanged == nil { |
| 1416 | return |
| 1417 | } |
| 1418 | ctx, cancel := context.WithTimeout(r.ctx(), toolsChangedTimeout) |
| 1419 | defer cancel() |
| 1420 | a := r.CurrentAgent() |
| 1421 | agentTools, err := a.StartedTools(ctx) |
| 1422 | if err != nil { |
| 1423 | return |
| 1424 | } |
| 1425 | r.onToolsChanged(ToolsetInfo(len(agentTools), false, r.currentAgentName())) |
| 1426 | } |
| 1427 | |
| 1428 | // emitAgentAndTeamInfo sends the AgentInfo and TeamInfo events that drive the |
| 1429 | // sidebar's agent/model/thinking display. It returns false when sending was |
nothing calls this directly
no test coverage detected