From d28f39d3aaaa9e8ffd0851d56bdd3d7bb39e3acf Mon Sep 17 00:00:00 2001 From: thzxx Date: Thu, 18 Jun 2026 14:22:21 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AD=90=E4=BB=BB=E5=8A=A1=E6=8B=86?= =?UTF-8?q?=E8=A7=A3=E6=8E=92=E9=99=A4=E6=96=87=E4=BB=B6=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=E9=81=BF=E5=85=8D=E6=8A=8A=E8=AE=BE=E5=AE=9A=E9=9B=86?= =?UTF-8?q?=E8=AF=AF=E6=8B=86=E6=88=9089=E4=B8=AA=E5=B9=B6=E8=A1=8C?= =?UTF-8?q?=E5=AD=90=E4=BB=BB=E5=8A=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 检测 📄 文件 标记时跳过子任务拆解 - 限制拆解只在内容 <5000 字符时触发 --- src/renderer/services/agent-engine.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/renderer/services/agent-engine.ts b/src/renderer/services/agent-engine.ts index 8a1a84a..36b2072 100644 --- a/src/renderer/services/agent-engine.ts +++ b/src/renderer/services/agent-engine.ts @@ -567,10 +567,12 @@ Shell: ${osInfo.shell} messages.push(userMsg); // P2-1: 自动子任务拆解 — 检测用户消息中的并行任务关键词 + // 排除文件内容(避免把小说/设定集误拆成子任务) const PARALLEL_PATTERNS = /同时|分别|以及|另外|此外|并且|也|also|and\s+also|separately|in\s+addition|meanwhile/i; const SUBTASK_SEPARATORS = /(?:^|\n)\s*(?:[1-9][.、)]|[-*•]\s+)/; const userText = userContent || ''; - const hasParallel = PARALLEL_PATTERNS.test(userText) && userText.length > 100; + const hasFileContent = userText.includes('📄 文件'); + const hasParallel = !hasFileContent && PARALLEL_PATTERNS.test(userText) && userText.length > 100 && userText.length < 5000; if (hasParallel && useTools) { // 尝试按数字列表拆分子任务