fix(aibox/botops): 修复重复输出问题
1. 服务端:is_continuation(工具调用后递归继续)时不再重复发送 "思考中"提示和reasoning_start信号,避免多轮工具调用时侧栏 出现多条冗余"思考中"消息 2. BotOps:line消息过滤前缀从5个扩展到9个,过滤掉"分析工具结果" "需要调用工具"等被后续具体信息覆盖的过渡提示 3. BotOps:移除危险的fallback分支(未知消息类型直接append到AI 聊天区),改为写入侧栏日志,防止非AI内容污染回复
This commit is contained in:
1 parent
f701730016
commit
27ab50ae68
2 files changed
+14
-5
No files matched your search
+11
-4
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user