Skip nil MCP servers in WithMCPServers

Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
Bryan Frimin
2026-03-13 19:26:29 +01:00
parent da9a594f79
commit cb4b893dfc
2 changed files with 18 additions and 1 deletions

View File

@@ -306,7 +306,11 @@ func WithResetToolChoice(reset bool) Option {
func WithMCPServers(servers ...*MCPServer) Option {
return func(a *Agent) {
a.mcpServers = append(a.mcpServers, servers...)
for _, s := range servers {
if s != nil {
a.mcpServers = append(a.mcpServers, s)
}
}
}
}