From f4249e5b0d9d8d6f29e3d0682dc95ff26fa00d8c Mon Sep 17 00:00:00 2001 From: "Yuyao Huang (Sam)" Date: Mon, 30 Mar 2026 01:19:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(agent):=20=E5=9C=A8passthrough=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E4=B8=8B=E6=B7=BB=E5=8A=A0direct=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E4=BB=A5=E7=BB=95=E8=BF=87=E8=B6=85=E6=97=B6=E6=A3=80=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当启用passthrough模式时,通过direct参数跳过60秒超时检查,确保消息直接发送而不受限制 --- agent/manager.py | 4 ++-- orchestrator/agent.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/manager.py b/agent/manager.py index 786fe62..79101e2 100644 --- a/agent/manager.py +++ b/agent/manager.py @@ -91,7 +91,7 @@ class SessionManager: ) return session - async def send(self, conv_id: str, message: str, user_id: Optional[str] = None) -> str: + async def send(self, conv_id: str, message: str, user_id: Optional[str] = None, direct: bool = False) -> str: async with self._lock: session = self._sessions.get(conv_id) if session is None: @@ -108,7 +108,7 @@ class SessionManager: session.started = True self._save() - if cc_timeout > 60: + if not direct and cc_timeout > 60: from agent.task_runner import task_runner from orchestrator.tools import get_current_chat, set_current_chat, set_current_user diff --git a/orchestrator/agent.py b/orchestrator/agent.py index 7eae79e..d09f037 100644 --- a/orchestrator/agent.py +++ b/orchestrator/agent.py @@ -159,7 +159,7 @@ class OrchestrationAgent: # Passthrough mode: if enabled and active session, bypass LLM if self._passthrough[user_id] and active_conv: try: - reply = await manager.send(active_conv, text, user_id=user_id) + reply = await manager.send(active_conv, text, user_id=user_id, direct=True) logger.info("<<< [passthrough] reply: %r", reply[:120]) return reply except KeyError: