mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
fix: ensure only active tools are processed in base_chat_node.py
--bug=1061252 --user=刘瑞斌 【工具】MCP被禁用后,依然可以在应用中调用 https://www.tapd.cn/62980211/s/1765960
This commit is contained in:
parent
a8e8a0580f
commit
0b6b45928d
|
|
@ -279,7 +279,7 @@ class BaseChatNode(IChatNode):
|
|||
mcp_servers_config = json.loads(mcp_servers)
|
||||
elif mcp_tool_id:
|
||||
mcp_tool = QuerySet(Tool).filter(id=mcp_tool_id).first()
|
||||
if mcp_tool:
|
||||
if mcp_tool and mcp_tool.is_active:
|
||||
mcp_servers_config = json.loads(mcp_tool.code)
|
||||
|
||||
if tool_enable:
|
||||
|
|
@ -288,6 +288,8 @@ class BaseChatNode(IChatNode):
|
|||
self.context['execute_ids'] = []
|
||||
for tool_id in tool_ids:
|
||||
tool = QuerySet(Tool).filter(id=tool_id).first()
|
||||
if not tool.is_active:
|
||||
continue
|
||||
executor = ToolExecutor(CONFIG.get('SANDBOX'))
|
||||
if tool.init_params is not None:
|
||||
params = json.loads(rsa_long_decrypt(tool.init_params))
|
||||
|
|
|
|||
Loading…
Reference in New Issue