-
fix(gateway): deny pending approvals at telegram shutdown (#5693)
发布于
2026-08-25 00:31:28 +00:00 A turn blocked in ApprovalBroker.wait holds an executor thread that only a
click can release, and polling has already stopped by the time the drain
runs. Setting turn_cancel and cancelling the asyncio task never reach that
thread. Telegram shuts its executor down with wait=True, so the thread
pinned the worker for up to MAX_APPROVAL_WAIT_SECONDS (180s), well past the
8s stop budget, and no denial reached the chat.Add ApprovalBroker.close(): deny everything outstanding and refuse new
requests, so the released turn's next approval fails closed instead of
parking again. Telegram's drain calls it before waiting, matching what Buzz
already does with its own pending-approval registry.Addresses the Greptile review left on #5218.
下载附件