Skip to content

Error during cleanupΒ #60

@hexmode

Description

@hexmode

I realize it says it can be ignored, but not having this error would be better.

You β€Ί /quit

πŸ‘‹ Goodbye! Thanks for using Mini Agent


Session Statistics:
────────────────────────────────────────
  Session Duration: 00:04:44
  Total Messages: 1
    - User Messages: 0
    - Assistant Replies: 0
    - Tool Calls: 0
  Available Tools: 19
────────────────────────────────────────

Cleaning up MCP connections...
Error during cleanup (can be ignored): Attempted to exit a cancel scope that isn't the current tasks's current cancel scope

an error occurred during closing of asynchronous generator <async_generator object stdio_client at 0x7fcf9b1bd000>
asyncgen: <async_generator object stdio_client at 0x7fcf9b1bd000>
  + Exception Group Traceback (most recent call last):
  |   File "/home/mah/.local/share/uv/tools/mini-agent/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 783, in __aexit__  |     raise BaseExceptionGroup(
  | BaseExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    |   File "/home/mah/.local/share/uv/tools/mini-agent/lib/python3.12/site-packages/mcp/client/stdio/__init__.py", line 189, in stdio_client
    |     yield read_stream, write_stream
    | GeneratorExit
    +------------------------------------

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/mah/.local/share/uv/tools/mini-agent/lib/python3.12/site-packages/mcp/client/stdio/__init__.py", line 183, in stdio_client    anyio.create_task_group() as tg,
    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mah/.local/share/uv/tools/mini-agent/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 789, in __aexit__
    if self.cancel_scope.__exit__(type(exc), exc, exc.__traceback__):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/mah/.local/share/uv/tools/mini-agent/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 461, in __exit__
    raise RuntimeError(
RuntimeError: Attempted to exit cancel scope in a different task than it was entered in

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions