mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-27 05:30:39 +00:00
Since CPython gh-105836 (backported to 3.13) an awaited executor future can complete without a loop iteration when the worker finished before the future was chained, so a middleware event a worker handed to the owner loop with call_soon_threadsafe may still be pending when flush() starts. The run-end flush() -> _detach_runtime_dependencies() sequence then dropped it. Yield to the loop once before draining and re-check _closed. Fixes #6564 Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>