fix(agent): snapshot active tasks before cancellation
This commit is contained in:
@@ -760,7 +760,7 @@ class AgentLoop:
|
||||
|
||||
Returns the total number of cancelled tasks + subagents.
|
||||
"""
|
||||
tasks = self._active_tasks.pop(key, set())
|
||||
tasks = tuple(self._active_tasks.pop(key, set()))
|
||||
cancelled = sum(1 for t in tasks if not t.done() and t.cancel())
|
||||
for t in tasks:
|
||||
with suppress(asyncio.CancelledError, Exception):
|
||||
|
||||
Reference in New Issue
Block a user