-
Notifications
You must be signed in to change notification settings - Fork 129
Open
Description
services.ai_decision_service.save_ai_decision 保存完成后会调用 asyncio.create_task(broadcast_model_chat_update(...)),但这段代码运行在普通后台线程,并没有正在运行的 asyncio 事件循环,所以实际会抛 RuntimeError: no running event loop。虽然异常被捕获并输出 WARNING,但 websocket 广播没有成功,Model Chat 列表也无法及时更新。
可以通过触发一条 AI 决策复现,System Logs 会出现多条 “Failed to broadcast AI decision update: no running event loop” 警告。建议把广播逻辑改成在主事件循环里调度(例如使用 asyncio.get_event_loop() + run_coroutine_threadsafe,或交给 websocket manager 的 loop),或者改成同步/BackgroundTask,从而解决这个 warning 并保证前端能收到实时更新。谢谢。
Metadata
Metadata
Assignees
Labels
No labels