Skip to content

[Bug] ConcurrencyExceptionGroup: A child concurrency group did not exit: modal_load_agent_refs_modal (state: EXITING). (2 sub-exceptions) #508

@evgunter

Description

@evgunter

(testing the bug report functionality by running mng conn then C-cing it until it dies)

Bug Report

An unexpected error occurred during command execution.

Error:

ConcurrencyExceptionGroup: A child concurrency group did not exit: `modal_load_agent_refs_modal` (state: EXITING). (2 sub-exceptions)

Traceback:

Traceback (most recent call last):
  File "/Users/ev/.local/share/uv/tools/mng/lib/python3.13/site-packages/click/core.py", line 1873, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/Users/ev/.local/share/uv/tools/mng/lib/python3.13/site-packages/click/core.py", line 1269, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ev/.local/share/uv/tools/mng/lib/python3.13/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "/Users/ev/.local/share/uv/tools/mng/lib/python3.13/site-packages/click/decorators.py", line 34, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/Users/ev/claude-dockerfile/mng/libs/mng/imbue/mng/cli/connect.py", line 464, in connect
    list_result = list_agents(mng_ctx, is_streaming=False)
  File "/Users/ev/claude-dockerfile/mng/libs/imbue_common/imbue/imbue_common/logging.py", line 66, in wrapper
    result = func(*args, **kwargs)
  File "/Users/ev/claude-dockerfile/mng/libs/mng/imbue/mng/api/list.py", line 190, in list_agents
    _list_agents_batch(
    ~~~~~~~~~~~~~~~~~~^
        mng_ctx=mng_ctx,
        ^^^^^^^^^^^^^^^^
    ...<3 lines>...
        results_lock=results_lock,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/Users/ev/claude-dockerfile/mng/libs/mng/imbue/mng/api/list.py", line 249, in _list_agents_batch
    agents_by_host, providers = load_all_agents_grouped_by_host(mng_ctx, provider_names, include_destroyed=True)
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ev/claude-dockerfile/mng/libs/imbue_common/imbue/imbue_common/logging.py", line 66, in wrapper
    result = func(*args, **kwargs)
  File "/Users/ev/claude-dockerfile/mng/libs/mng/imbue/mng/api/list.py", line 720, in load_all_agents_grouped_by_host
    with ConcurrencyGroupExecutor(
         ~~~~~~~~~~~~~~~~~~~~~~~~^
        parent_cg=mng_ctx.concurrency_group, name="load_all_agents_grouped_by_host", max_workers=32
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ) as executor:
    ^
  File "/Users/ev/claude-dockerfile/mng/libs/concurrency_group/imbue/concurrency_group/executor.py", line 37, in __exit__
    self._cg.__exit__(exc_type, exc_val, exc_tb)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ev/claude-dockerfile/mng/libs/concurrency_group/imbue/concurrency_group/concurrency_group.py", line 138, in __exit__
    self._exit(exc_value)
    ~~~~~~~~~~^^^^^^^^^^^
  File "/Users/ev/claude-dockerfile/mng/libs/concurrency_group/imbue/concurrency_group/concurrency_group.py", line 154, in _exit
    self._wait_for_all_strands_to_finish_with_timeout(self.exit_timeout_seconds)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ev/claude-dockerfile/mng/libs/concurrency_group/imbue/concurrency_group/concurrency_group.py", line 232, in _wait_for_all_strands_to_finish_with_timeout
    tracked_thread.thread.join(timeout=join_timeout)
    ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/ev/claude-dockerfile/mng/libs/concurrency_group/imbue/concurrency_group/thread_utils.py", line 70, in join
    super().join(timeout)
    ~~~~~~~~~~~~^^^^^^^^^
  File "/Users/ev/.local/share/uv/python/cpython-3.13.9-macos-aarch64-none/lib/python3.13/threading.py", line 1094, in join
    self._handle.join(timeout)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^
KeyboardInterrupt

During handling of the above exception, another exception occurred:

  + Exception Group Traceback (most recent call last):
  |   Fil

_(truncated)_

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