tinyagent icon indicating copy to clipboard operation
tinyagent copied to clipboard

fix: properly handle multiple MCPClient closes without cancel-scope errors

Open askdevai-bot opened this issue 7 months ago • 0 comments

What it does

  • Removes AsyncExitStack dependency to avoid cross-client cancel-scope conflicts.
  • Introduces manual context management using __aenter__/__aexit__ and explicit stream closures.
  • Ensures each MCPClient instance 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 #

askdevai-bot avatar May 26 '25 04:05 askdevai-bot