From 71442d26ec21b62ffc63ee47e3be873c6d036344 Mon Sep 17 00:00:00 2001 From: Soulter <905617992@qq.com> Date: Sat, 28 Jun 2025 19:58:36 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E7=A7=BB=E9=99=A4=E4=B8=8D=E5=BF=85?= =?UTF-8?q?=E8=A6=81=E7=9A=84=20MCP=20=E4=BC=9A=E8=AF=9D=E6=8E=A7=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../pipeline/process_stage/method/llm_request.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/astrbot/core/pipeline/process_stage/method/llm_request.py b/astrbot/core/pipeline/process_stage/method/llm_request.py index 1424a217e..e352953aa 100644 --- a/astrbot/core/pipeline/process_stage/method/llm_request.py +++ b/astrbot/core/pipeline/process_stage/method/llm_request.py @@ -72,12 +72,12 @@ class LLMRequestSubStage(Stage): if not self.ctx.astrbot_config["provider_settings"]["enable"]: logger.debug("未启用 LLM 能力,跳过处理。") return - + # 检查会话级别的LLM启停状态 if not SessionServiceManager.should_process_llm_request(event): logger.debug(f"会话 {event.unified_msg_origin} 禁用了 LLM,跳过处理。") return - + umo = event.unified_msg_origin provider = self.ctx.plugin_manager.context.get_using_provider(umo=umo) if provider is None: @@ -461,18 +461,6 @@ class LLMRequestSubStage(Stage): try: func_tool = req.func_tool.get_func(func_tool_name) if func_tool.origin == "mcp": - # 检查会话级MCP开关 - if not SessionServiceManager.should_process_mcp_request(event): - logger.debug(f"会话 {event.unified_msg_origin} 禁用了 MCP,跳过工具调用: {func_tool_name}") - tool_call_result.append( - ToolCallMessageSegment( - role="tool", - tool_call_id=func_tool_id, - content="MCP工具调用已在此会话中被禁用", - ) - ) - continue - logger.info( f"从 MCP 服务 {func_tool.mcp_server_name} 调用工具函数:{func_tool.name},参数:{func_tool_args}" )