From 12feaac95881b8070b35d18b0a469bddc56e27f6 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Thu, 10 Jul 2025 17:01:17 +0800 Subject: [PATCH] feat: add check for inactive tool libraries MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1058425 --user=刘瑞斌 【工具】应用中引用的工具被禁用后,对话时依然可以调用工具 https://www.tapd.cn/62980211/s/1728140 --- .../flow/step_node/tool_lib_node/impl/base_tool_lib_node.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/application/flow/step_node/tool_lib_node/impl/base_tool_lib_node.py b/apps/application/flow/step_node/tool_lib_node/impl/base_tool_lib_node.py index a99f4f5b..213de279 100644 --- a/apps/application/flow/step_node/tool_lib_node/impl/base_tool_lib_node.py +++ b/apps/application/flow/step_node/tool_lib_node/impl/base_tool_lib_node.py @@ -112,6 +112,8 @@ def valid_function(tool_lib, workspace_id): tool_lib = get_authorized_tool(QuerySet(Tool).filter(id=tool_lib.id), workspace_id).first() if tool_lib is None: raise Exception(_("Tool does not exist")) + if not tool_lib.is_active: + raise Exception(_("Tool is not active")) class BaseToolLibNodeNode(IToolLibNode):