Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.
Python agentagentic-aiagentic-frameworkagentic-workflowaiautomationclaudedeepseekgenaigptllmlow-codemcpnextjsno-codeopenaipythonskillsworkflow
fix: check webhook key of Wecom tool in valid UUID form and fix typo (#2719)
Bowen Liang0ac250a035b2
diff --git a/api/core/tools/provider/builtin/wecom/tools/wecom_group_bot.py b/api/core/tools/provider/builtin/wecom/tools/wecom_group_bot.pyindex 5a536cca502..aca10e6a7f4 100644--- a/api/core/tools/provider/builtin/wecom/tools/wecom_group_bot.py+++ b/api/core/tools/provider/builtin/wecom/tools/wecom_group_bot.py@@ -4,9 +4,10 @@ import httpxfrom core.tools.entities.tool_entities import ToolInvokeMessagefrom core.tools.tool.builtin_tool import BuiltinTool+from core.tools.utils.uuid_utils import is_valid_uuid-class WecomRepositoriesTool(BuiltinTool):+class WecomGroupBotTool(BuiltinTool):def _invoke(self, user_id: str, tool_parameters: dict[str, Any]) -> Union[ToolInvokeMessage, list[ToolInvokeMessage]]:"""@@ -17,8 +18,9 @@ class WecomRepositoriesTool(BuiltinTool):return self.create_text_message('Invalid parameter content')hook_key = tool_parameters.get('hook_key', '')- if not hook_key:- return self.create_text_message('Invalid parameter hook_key')+ if not is_valid_uuid(hook_key):+ return self.create_text_message(+ f'Invalid parameter hook_key ${hook_key}, not a valid UUID')msgtype = 'text'api_url = 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send'diff --git a/api/core/tools/provider/builtin/wecom/wecom.py b/api/core/tools/provider/builtin/wecom/wecom.pyindex 6380061b4f2..7a2576b668f 100644--- a/api/core/tools/provider/builtin/wecom/wecom.py+++ b/api/core/tools/provider/builtin/wecom/wecom.py@@ -1,8 +1,8 @@-from core.tools.provider.builtin.wecom.tools.wecom_group_bot import WecomRepositoriesTool+from core.tools.provider.builtin.wecom.tools.wecom_group_bot import WecomGroupBotToolfrom core.tools.provider.builtin_tool_provider import BuiltinToolProviderControllerclass WecomProvider(BuiltinToolProviderController):def _validate_credentials(self, credentials: dict) -> None:- WecomRepositoriesTool()+ WecomGroupBotTool()passdiff --git a/api/core/tools/utils/uuid_utils.py b/api/core/tools/utils/uuid_utils.pynew file mode 100644index 00000000000..3046c08c89f--- /dev/null+++ b/api/core/tools/utils/uuid_utils.py@@ -0,0 +1,9 @@+import uuid+++def is_valid_uuid(uuid_str: str) -> bool:+ try:+ uuid.UUID(uuid_str)+ return True+ except Exception:+ return False