Skip to content

Commit 250fc10

Browse files
committed
fix: Yield to give mcp_session_task a chance to finis
1 parent 8df221e commit 250fc10

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/seclab_taskflow_agent/runner.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,9 @@ async def deploy_task_agents(
462462
continue
463463
except Exception:
464464
logging.exception("Exception in mcp server cleanup task")
465+
# Yield to give mcp_session_task a chance to finish after being
466+
# signalled, especially when there are no servers to clean up.
467+
await asyncio.sleep(0)
465468
# If the MCP session task is still running (e.g. all servers were
466469
# already disconnected and the cleanup loop above never entered)
467470
# cancel it explicitly so a dangling task can't keep the event

0 commit comments

Comments
 (0)