mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-04 23:17:20 +08:00
refactor: drain traditional agent streams
This commit is contained in:
@@ -2221,9 +2221,11 @@ async def _web_agent_stream_impl(
|
||||
return
|
||||
yield ": heartbeat\n\n"
|
||||
except asyncio.CancelledError:
|
||||
return
|
||||
finally:
|
||||
if not collection_task.done():
|
||||
collection_task.cancel()
|
||||
return
|
||||
await asyncio.gather(collection_task, return_exceptions=True)
|
||||
|
||||
assistant_message = _build_web_agent_display_message_from_events(events)
|
||||
display_messages.append(assistant_message)
|
||||
|
||||
Reference in New Issue
Block a user