mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-26 05:06:59 +00:00
* Track DingTalk stream message tasks to avoid dangling tasks The stream loop handed each frame to client.background_task() via a bare asyncio.create_task(...) whose result was dropped. asyncio only keeps a weak reference to a task once it awaits, so the task could be garbage-collected mid-execution (silently dropping a message) and any exception it raised was never observed. Keep a strong reference to each handler task and discard it via a done callback, matching the background-task tracking used elsewhere (e.g. the subagent executor and the MCP session pool). * fix(channels): observe DingTalk stream task failures --------- Co-authored-by: lisry-1 <lisry-1@users.noreply.github.com> Co-authored-by: Willem Jiang <willem.jiang@gmail.com>