From 400c641f3d255d3679829edcf7999e99263961a4 Mon Sep 17 00:00:00 2001 From: thzxx Date: Thu, 18 Jun 2026 14:25:40 +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=9D=A1=E4=BB=B6=E6=9B=B4=E5=90=88=E7=90=86=E2=80=94?= =?UTF-8?q?=E2=80=94=E6=9C=89=E9=99=84=E4=BB=B6=E6=88=96=E5=86=85=E5=AE=B9?= =?UTF-8?q?=E8=BF=87=E9=95=BF=E6=97=B6=E8=B7=B3=E8=BF=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 有图片/视频时跳过(图文消息不适合拆解) - 内容 <50 或 >2000 字符时跳过(太短没意义,太长是文件内容) --- src/renderer/services/agent-engine.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/renderer/services/agent-engine.ts b/src/renderer/services/agent-engine.ts index 36b2072..fc2220b 100644 --- a/src/renderer/services/agent-engine.ts +++ b/src/renderer/services/agent-engine.ts @@ -566,13 +566,13 @@ Shell: ${osInfo.shell} }; messages.push(userMsg); - // P2-1: 自动子任务拆解 — 检测用户消息中的并行任务关键词 - // 排除文件内容(避免把小说/设定集误拆成子任务) + // 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 hasFileContent = userText.includes('📄 文件'); - const hasParallel = !hasFileContent && PARALLEL_PATTERNS.test(userText) && userText.length > 100 && userText.length < 5000; + const hasAttachments = (images?.length || 0) > 0; + const hasParallel = !hasAttachments && userText.length > 50 && userText.length < 2000 + && PARALLEL_PATTERNS.test(userText); if (hasParallel && useTools) { // 尝试按数字列表拆分子任务