toolNameMatchesAny reports whether name matches any of the patterns. Each pattern is tried as a filepath.Match glob; a malformed pattern falls back to an exact string comparison.
(name string, patterns []string)
| 1243 | // pattern is tried as a filepath.Match glob; a malformed pattern falls back |
| 1244 | // to an exact string comparison. |
| 1245 | func toolNameMatchesAny(name string, patterns []string) bool { |
| 1246 | for _, p := range patterns { |
| 1247 | if p == name { |
| 1248 | return true |
| 1249 | } |
| 1250 | if ok, err := filepath.Match(p, name); err == nil && ok { |
| 1251 | return true |
| 1252 | } |
| 1253 | } |
| 1254 | return false |
| 1255 | } |
| 1256 | |
| 1257 | // skillSubSessionTools augments the agent's tools for a fork-mode skill |
| 1258 | // sub-session: it applies the skill's allowed-tools allow-list to the |
no outgoing calls