-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
When using the synchronous versions of create and run, and then trying to perform cleanup of the tool resources, the runtime will stall:
from any_agent import AnyAgent, AgentConfig
from any_agent.config import MCPStdio
import asyncio
tool_args = [
"-y",
"@modelcontextprotocol/server-filesystem",
".",
]
agent = AnyAgent.create(
agent_framework="openai",
agent_config=AgentConfig(
model_id="o3",
instructions="Use the tools to answer the query.",
tools=[
MCPStdio(
command="npx",
args=tool_args,
tools=[
"read_file",
"list_directory",
],
),
],
),
)
agent.run("Find all files in the current directory that have 'primer' in the title.")
asyncio.run(agent._mcp_clients[0].disconnect())The cleanup procedures are not yet well defined, so this issue may also include a first version of cleanup contracts inside the library and towards the user.
Metadata
Metadata
Assignees
Labels
No labels