filterExcludedTools removes tools whose names appear in the excluded list. This is used by skill sub-sessions to prevent recursive run_skill calls.
(agentTools []tools.Tool, excluded []string)
| 1206 | // filterExcludedTools removes tools whose names appear in the excluded list. |
| 1207 | // This is used by skill sub-sessions to prevent recursive run_skill calls. |
| 1208 | func filterExcludedTools(agentTools []tools.Tool, excluded []string) []tools.Tool { |
| 1209 | if len(excluded) == 0 { |
| 1210 | return agentTools |
| 1211 | } |
| 1212 | excludeSet := make(map[string]bool, len(excluded)) |
| 1213 | for _, name := range excluded { |
| 1214 | excludeSet[name] = true |
| 1215 | } |
| 1216 | filtered := make([]tools.Tool, 0, len(agentTools)) |
| 1217 | for _, t := range agentTools { |
| 1218 | if !excludeSet[t.Name] { |
| 1219 | filtered = append(filtered, t) |
| 1220 | } |
| 1221 | } |
| 1222 | return filtered |
| 1223 | } |
| 1224 | |
| 1225 | // filterAllowedTools keeps only tools whose names match an entry in allowed |
| 1226 | // (filepath.Match-style glob, falling back to an exact match). An empty |
no outgoing calls