From bda9f31a1be6eb5af29363c37e6cbe7441a8e926 Mon Sep 17 00:00:00 2001 From: ymq Date: Wed, 19 Aug 2026 13:52:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=85=B3=E9=97=AD=20agent=20=E4=BC=9A?= =?UTF-8?q?=E8=AF=9D=E5=8D=B1=E9=99=A9=E5=91=BD=E4=BB=A4=E7=A1=AE=E8=AE=A4?= =?UTF-8?q?=E2=80=94=E2=80=94=E8=87=AA=E5=8A=A8=E7=90=86=E8=A7=A3=E5=92=8C?= =?UTF-8?q?=E6=8E=A5=E5=8F=97=E5=85=A8=E9=83=A8=E7=A1=AE=E8=AE=A4=EF=BC=8C?= =?UTF-8?q?=E4=B8=8D=E5=86=8D=E6=89=93=E6=96=AD=E7=94=A8=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pipeline_service/agent_loop_v2.py | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/pipeline_service/agent_loop_v2.py b/pipeline_service/agent_loop_v2.py index 770e525..b277131 100644 --- a/pipeline_service/agent_loop_v2.py +++ b/pipeline_service/agent_loop_v2.py @@ -1269,14 +1269,12 @@ class AgentExecutor: return any(d in c for d in dangerous) def _needs_confirmation(self, tool_name: str, params: dict = None) -> bool: - """检查工具是否需要用户确认。run_command 只对危险命令确认,普通命令自动执行。""" - if self._tool_registry: - tool = self._tool_registry.get(tool_name) - if tool and tool.requires_confirmation: - if tool_name == "run_command": - cmd = (params or {}).get("command", "") - return self._is_dangerous_command(cmd) - return True + """检查工具是否需要用户确认。 + + 已关闭确认机制:agent 会话应能理解和接受全部确认,执行任务时 + 不再打断用户要求确认(危险命令也自动执行,不再弹「请回复确认」)。 + 如需恢复按命令危险度确认,改回读取 tool.requires_confirmation + _is_dangerous_command。 + """ return False