From 44b8d0b427b9669085457dec078bea80e2b064f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=85=AC=E6=98=8E?= <83812544+Ed1s0nZ@users.noreply.github.com> Date: Sun, 8 Feb 2026 22:01:56 +0800 Subject: [PATCH] Add files via upload --- internal/security/executor.go | 14 +++++++++++++- requirements.txt | 7 ++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/internal/security/executor.go b/internal/security/executor.go index 48ec06ad..55700fc6 100644 --- a/internal/security/executor.go +++ b/internal/security/executor.go @@ -1213,7 +1213,15 @@ func (e *Executor) buildInputSchema(toolConfig *config.ToolConfig) map[string]in required := []string{} for _, param := range toolConfig.Parameters { - // 转换类型为OpenAI/JSON Schema标准类型 + // 跳过 name 为空的参数(避免 YAML 中 name: null 或空导致非法 schema) + if strings.TrimSpace(param.Name) == "" { + e.logger.Debug("跳过无名称的参数", + zap.String("tool", toolConfig.Name), + zap.String("type", param.Type), + ) + continue + } + // 转换类型为OpenAI/JSON Schema标准类型(空类型默认为 string) openAIType := e.convertToOpenAIType(param.Type) prop := map[string]interface{}{ @@ -1255,6 +1263,10 @@ func (e *Executor) buildInputSchema(toolConfig *config.ToolConfig) map[string]in // convertToOpenAIType 将配置中的类型转换为OpenAI/JSON Schema标准类型 func (e *Executor) convertToOpenAIType(configType string) string { + // 空或 null 类型统一视为 string,避免非法 schema 导致工具调用失败 + if strings.TrimSpace(configType) == "" { + return "string" + } switch configType { case "bool": return "boolean" diff --git a/requirements.txt b/requirements.txt index 8fa08cae..62400c6c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,8 @@ # Python HTTP helpers leveraged by tools like api-fuzzer, dnslog, http-intruder, http-framework-test requests>=2.32.3 -# dirsearch (Kali/system dirsearch) 依赖: -defusedxml>=0.7.0 -httpx>=0.27.0 -charset-normalizer>=3.3.2 -chardet>=5.2.0 +# dirsearch:用 python3 -m dirsearch 时由本依赖提供(含 defusedxml 等) +dirsearch>=0.4.3 # Python exploitation / analysis frameworks referenced by tool recipes # angr>=9.2.96