tinyagent
tinyagent copied to clipboard
fix: properly handle multiple MCPClient closes without cancel-scope errors
What it does
- Removes
AsyncExitStackdependency to avoid cross-client cancel-scope conflicts. - Introduces manual context management using
__aenter__/__aexit__and explicit stream closures. - Ensures each
MCPClientinstance cleans up independently without errors when multiple are active.
Why is this needed?
Closing one client previously caused errors on others due to shared cancel scopes. This PR isolates cleanup per client.
Closes #