We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5dd6ec2 commit e628977Copy full SHA for e628977
1 file changed
src/seclab_taskflow_agent/runner.py
@@ -475,6 +475,14 @@ async def _run_streamed() -> None:
475
continue
476
except Exception:
477
logging.exception("Exception in mcp server cleanup task")
478
+ # Cancel the MCP session task if it's still running to prevent
479
+ # the asyncio event loop from spinning on a dangling task.
480
+ if not mcp_sessions.done():
481
+ mcp_sessions.cancel()
482
+ try:
483
+ await mcp_sessions
484
+ except (asyncio.CancelledError, Exception):
485
+ pass
486
487
488
async def run_main(
0 commit comments