fix(botops): v1.3 - 适配服务端中断机制,Ctrl+C立即可靠停止
问题:收到interrupt_ack时仅显示系统通知,没有立即收尾前端状态: - 思考区域一直停留在"💭 思考中..."状态,不会更新 - AI回复状态未重置,后续残留chunk可能继续追加 - 服务端不发送reasoning_end,思考区域无法正常结束 修复: - ChatView新增abort_reasoning()方法:中断时将思考区域标签更新为"🛑 思考已中断"(保留已展示内容) - append_reasoning()增加_ai_finalized检查,中断后丢弃残留思考片段,防止重新创建思考区域 - app.py收到interrupt_ack时:先abort_reasoning()更新思考区域,再finish_ai()收尾AI状态,最后显示系统通知 - 中断后服务端发来的残留chunk/reasoning/complete均被安全忽略(append_ai已有_finalized检查,finish_ai幂等) - 更新README v1.3日志
This commit is contained in:
1 parent
9d737897df
commit
c7ef7e715c
3 files changed
+24
No files matched your search
@@ -226,6 +226,9 @@ class BotOpsApp(App):
|
||||
f"❌ [{data.get('task_id', '?')}] {data.get('task_title', '?')}: "
|
||||
f"{data.get('error', '未知错误')}")
|
||||
elif t == "interrupt_ack":
|
||||
# 服务端确认中断:立即收尾前端状态(更新思考区域为已中断、结束AI回复)
|
||||
await self.chat.abort_reasoning()
|
||||
await self.chat.finish_ai("")
|
||||
await self.notify_system(f"🛑 {content}")
|
||||
elif t == "error":
|
||||
await self.notify_system(f"❌ {content}", level="error")
|
||||
|
||||
Reference in new issue
Block a user