From 7fdbb981175ee28a9958985cd848499f48ee693b Mon Sep 17 00:00:00 2001 From: ymq Date: Mon, 24 Aug 2026 14:51:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=88=A0=E9=99=A4=E7=A1=AC=E7=BC=96?= =?UTF-8?q?=E7=A0=81=E5=81=9C=E6=AD=A2=E5=85=B3=E9=94=AE=E5=AD=97=E5=8C=B9?= =?UTF-8?q?=E9=85=8D(=E6=8A=8A'=E4=B8=BA=E4=BB=80=E4=B9=88=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E5=8F=96=E6=B6=88=E4=BA=86'=E8=AF=AF=E5=88=A4?= =?UTF-8?q?=E4=B8=BA=E5=81=9C=E6=AD=A2=E6=8C=87=E4=BB=A4),=E4=BA=A4LLM?= =?UTF-8?q?=E6=84=8F=E5=9B=BE=E8=AF=86=E5=88=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- wwwroot/api/cockpit_chat_v2.dspy | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/wwwroot/api/cockpit_chat_v2.dspy b/wwwroot/api/cockpit_chat_v2.dspy index 72fae61..cac8ff3 100644 --- a/wwwroot/api/cockpit_chat_v2.dspy +++ b/wwwroot/api/cockpit_chat_v2.dspy @@ -76,13 +76,9 @@ if action == 'send_message': if file_ctx: prompt = "用户本次上传了以下文件:\n\n" + file_ctx + "\n用户指令:" + prompt - # ── 意图识别:停止类指令 ── - stop_keywords = ['停止', '取消', '停下', '终止', '停', 'stop', 'cancel', 'abort'] - if any(kw == prompt.strip().lower() or kw in prompt.strip().lower() for kw in stop_keywords): - async def _stop_stream(): - yield json.dumps({"content": "已停止当前任务。"}, ensure_ascii=False) + '\n' - return await stream_response(request, _stop_stream, 'text/plain; charset=utf-8') - + # 停止/暂停指令不再用硬编码关键字短路——交给 LLM 意图识别(agent system prompt 已明确: + # 用户指令「暂停/停止推进」时调 pause_project)。硬编码子串匹配会把「为什么任务取消了」这类 + # 分析问题误判为停止指令(2026-08 实测),故删除。 uid = await get_user() if not uid: uid = 'user-01' # 测试兼容