fix(aibox/botops): 修复两处重复输出根因
1. 侧栏重复:_handle_tool_calls 中 msg_type in ("line", "complete")
将流式工具末尾的 complete 信号也当作 line 转发,导致所有支持
流式输出的工具(get_current_time、run_command、read_file等20+个)
结果在侧栏显示两次。改为仅转发 "line" 类型。
2. 聊天区Markdown列表重复:Textual 的 Markdown.append() 在 chunk
边界切断 Markdown 语法(如列表项 "- "被拆成两个chunk)时,增量
解析可能导致内容重复渲染。改为累积完整文本后调用 update() 整体
重新解析,避免增量解析的边界问题。
This commit is contained in:
1 parent
66963092a3
commit
f3d06252bb
2 files changed
+11
-4
No files matched your search
+3
-1
@@ -7068,7 +7068,9 @@ class DeepSeekChat:
|
||||
while not output_queue.empty():
|
||||
try:
|
||||
msg_type, content = output_queue.get_nowait()
|
||||
if output_callback and msg_type in ("line", "complete"):
|
||||
if output_callback and msg_type == "line":
|
||||
# 只转发"line"类型;"complete"是流式结束信号,不作为行输出
|
||||
# (之前complete也被转发导致工具结果在侧栏显示两次)
|
||||
output_callback("line", str(content) if content is not None else "")
|
||||
has_stream_output = True
|
||||
except queue.Empty:
|
||||
|
||||
Reference in new issue
Block a user