ACP / MCP 完善

This commit is contained in:
2026-06-11 12:43:18 +08:00
parent 1415d3b43b
commit 0561e126cd
22 changed files with 786 additions and 219 deletions
+6 -5
View File
@@ -332,13 +332,14 @@ func extractToolName(toolCall json.RawMessage) string {
return ""
}
// allowlistHit 判断工具是否在白名单内。含 "*" 表示全部放行;toolName 为空时不放行。
// allowlistHit 判断工具是否在白名单内。含 "*" 表示放行全部可识别的工具;
// toolName 为空(无法识别的 tool call)时一律不放行,保守走人工审批。
func allowlistHit(allowlist []string, toolName string) bool {
if toolName == "" {
return false
}
for _, a := range allowlist {
if a == "*" {
return true
}
if toolName != "" && a == toolName {
if a == "*" || a == toolName {
return true
}
}