I've been using the CLI all day and for some reaso...
# dev-help
f
I've been using the CLI all day and for some reason I can no longer get past the "Initializing..." state. Tried multiple times
I get this output when interrupting:
Copy code
^CException ignored in: <module 'threading' from '/Users/.../.pyenv/versions/3.12.8/lib/python3.12/threading.py'>
Traceback (most recent call last):
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/threading.py", line 1594, in _shutdown
    atexit_call()
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/concurrent/futures/thread.py", line 31, in _python_exit
    t.join()
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/threading.py", line 1149, in join
    self._wait_for_tstate_lock()
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/threading.py", line 1169, in _wait_for_tstate_lock
    if lock.acquire(block, timeout):
       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyboardInterrupt: 
ERROR:asyncio:Task exception was never retrieved
future: <Task finished name='Task-10' coro=<StdioTransport.connect.<locals>._connect_task() done, defined at /Users/.../Library/Caches/pypoetry/virtualenvs/openhands-ai-q6lpIkNh-py3.12/lib/python3.12/site-packages/fastmcp/client/transports.py:352> exception=FileNotFoundError(2, 'No such file or directory')>
Traceback (most recent call last):
  File "/Users/.../Library/Caches/pypoetry/virtualenvs/openhands-ai-q6lpIkNh-py3.12/lib/python3.12/site-packages/fastmcp/client/transports.py", line 358, in _connect_task
    transport = await stack.enter_async_context(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/contextlib.py", line 659, in enter_async_context
    result = await _enter(cm)
             ^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/contextlib.py", line 210, in __aenter__
    return await anext(self.gen)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Library/Caches/pypoetry/virtualenvs/openhands-ai-q6lpIkNh-py3.12/lib/python3.12/site-packages/mcp/client/stdio/__init__.py", line 115, in stdio_client
    process = await _create_platform_compatible_process(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Library/Caches/pypoetry/virtualenvs/openhands-ai-q6lpIkNh-py3.12/lib/python3.12/site-packages/mcp/client/stdio/__init__.py", line 232, in _create_platform_compatible_process
    process = await anyio.open_process(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Library/Caches/pypoetry/virtualenvs/openhands-ai-q6lpIkNh-py3.12/lib/python3.12/site-packages/anyio/_core/_subprocesses.py", line 190, in open_process
    return await get_async_backend().open_process(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../Library/Caches/pypoetry/virtualenvs/openhands-ai-q6lpIkNh-py3.12/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2561, in open_process
    process = await asyncio.create_subprocess_exec(
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/asyncio/subprocess.py", line 224, in create_subprocess_exec
    transport, protocol = await loop.subprocess_exec(
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/asyncio/base_events.py", line 1749, in subprocess_exec
    transport = await self._make_subprocess_transport(
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/asyncio/unix_events.py", line 211, in _make_subprocess_transport
    transp = _UnixSubprocessTransport(self, protocol, args, shell,
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/asyncio/base_subprocess.py", line 36, in __init__
    self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/asyncio/unix_events.py", line 820, in _start
    self._proc = subprocess.Popen(
                 ^^^^^^^^^^^^^^^^^
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/Users/.../.pyenv/versions/3.12.8/lib/python3.12/subprocess.py", line 1955, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'uvx'
Huh, looks like there was an update and
uv
was required. Unexpected since I didn't require to install it the first time
c
@full-greece-2387 is it because of the MCP support?
c
Or is it because of the shortcuts to
uvx
?
c
I think it is likely MCP since
mcp/client/stdio/__init__.py
is in the stack trace ๐Ÿ˜ž
๐Ÿ‘ 1
f
I think the issue is in the MCP support PR we also load MCP configs from microagents, and in OpenHands repo we have the
fetch
MCP server defined in
default-tools.md
microagent, and this requires
uvx
. A fix is maybe to disable loading MCP servers from microagents for CLI and only use a single
config.toml
file, do you think it makes sense to do that?
I opened a relevant issue recently to add
fetch
MCP server by default to make it similar to OpenHands in the UI, but it seems to be not straightforward b.c. users may not have
uvx
installed: https://github.com/All-Hands-AI/OpenHands/issues/9875
c
Ahh. I think
fetch
is necessary for a good user experience though, with the CLI. Without it, people would be limited to the agent finding idk, ways like curl to get something from the web? Granted, curl works, but it doesnโ€™t seem best
nod 1
What if we require uvx?
c
yeah that will make things a lot easier
but one more stuff we ask user to install ๐Ÿ˜…
c
yes, well we also use it for alias, so that would fail too ๐Ÿคทโ€โ™‚๏ธ
c
nod sounds like it is probably not too much asking user for uv..
f
๐Ÿ‘ 1