Skip to content

Commit ff99de4

Browse files
fix: mcp cancel scope cross task spin
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
1 parent e0133b4 commit ff99de4

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

astrbot/core/provider/func_tool_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ async def connect_and_lifecycle() -> None:
724724
raise
725725
finally:
726726
# Cleanup in the same task that entered the anyio contexts
727-
await self._terminate_mcp_client(name)
727+
await asyncio.shield(self._terminate_mcp_client(name))
728728

729729
lifecycle_task = asyncio.create_task(
730730
connect_and_lifecycle(), name=f"mcp-client:{name}"

0 commit comments

Comments
 (0)