mirror of
https://github.com/bytedance/deer-flow.git
synced 2026-10-28 06:00:38 +00:00
The extension notify loop told a spent shared budget apart from a TimeoutError a contributor raised on its own by re-reading loop.time() after the await and comparing it with the deadline. The event loop runs a scheduled timeout up to one clock_resolution early (BaseEventLoop._run_once compares each handle's _when against now + clock_resolution), so on a coarse clock -- Windows' ~15.6 ms against budgets as small as 20 ms -- that read can still land strictly before the deadline. Budget exhaustion was then logged as a phantom hook failure (ERROR plus an asyncio-internal traceback), and the same lag let a later contributor run on a budget that had already run out. Classify from asyncio.timeout's own expiry (expired()) instead of a second clock read, and latch budget_spent once the budget is gone so the skip of later contributors is deterministic too. Fixes #6453 Co-authored-by: sxh313 <sxh313@users.noreply.github.com>