diff --git a/BotOps/app.py b/BotOps/app.py index ca3170f..0b8f450 100644 --- a/BotOps/app.py +++ b/BotOps/app.py @@ -186,10 +186,16 @@ class BotOpsApp(App): stripped = content.strip() if not stripped: pass - elif stripped.startswith(("💬 助手", "💬 Assistant", "🤔 思考中", "🤔 Thinking", "🤔 深度思考中")): - pass # 助手前缀 / 思考提示:聊天区已有对应区域,无需展示 + elif stripped.startswith(( + "💬 助手", "💬 Assistant", # 助手前缀(聊天区已有对应区域) + "🤔 思考中", "🤔 Thinking", # 思考提示(聊天区已有思考区域) + "🤔 深度思考中", + "🤔 分析工具结果", "🤔 Analyzing", # 工具分析提示(后续有具体工具输出,此为冗余) + "🔧 需要调用工具", "🔧 Need to call",# 工具调用前置提示(后续有"调用工具: xxx"具体提示) + )): + pass # 冗余/有替代展示的提示行,过滤避免重复 else: - # 🔧 调用工具 / 工具输出 / 🤔 分析工具结果 等 → 任务侧栏 + # 🔧 调用工具: xxx / 工具输出 / 用户中断提示等 → 任务侧栏 self.tasks.write(stripped) elif t == "complete": # complete 携带完整全文,用于对齐已显示内容 @@ -244,7 +250,8 @@ class BotOpsApp(App): elif t == "notification": await self.notify_system(f"🔔 {content}") elif content: - await self.chat.append_ai(content) + # 未知消息类型不追加到AI聊天区(避免非AI内容污染回复),仅记入侧栏日志 + self.tasks.write(f"[未知消息 type={t}] {str(content)[:200]}") # ── 连接状态回调 ────────────────────────────────────────────────────── async def _on_ws_state(self, state: str, detail: str): diff --git a/aibox/aibox.py b/aibox/aibox.py index 86284a1..2334e97 100644 --- a/aibox/aibox.py +++ b/aibox/aibox.py @@ -7267,7 +7267,9 @@ class DeepSeekChat: payload["tool_choice"] = "auto" current_time = datetime.now().strftime("%H:%M:%S") - if output_callback: + if output_callback and not is_continuation: + # 工具调用后的递归继续(is_continuation=True)时不重复发送"思考中"提示, + # 因为前端已处于活跃AI状态,重复提示会导致冗余/重复输出 output_callback("line", f"\n{i18n.get('thinking', current_time)}\n") if constants.REASONING_ENABLED: output_callback("reasoning_start", "🤔 思考中...")