We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88c1d77 commit 6a50d31Copy full SHA for 6a50d31
astrbot/core/agent/mcp_client.py
@@ -345,9 +345,6 @@ async def _call_with_retry():
345
346
async def cleanup(self):
347
"""Clean up resources including old exit stacks from reconnections"""
348
- # Set running_event first to unblock any waiting tasks
349
- self.running_event.set()
350
-
351
# Close current exit stack
352
try:
353
await self.exit_stack.aclose()
@@ -359,6 +356,9 @@ async def cleanup(self):
359
356
# Just clear the list to release references
360
357
self._old_exit_stacks.clear()
361
358
+ # Set running_event first to unblock any waiting tasks
+ self.running_event.set()
+
362
363
class MCPTool(FunctionTool, Generic[TContext]):
364
"""A function tool that calls an MCP service."""
0 commit comments