Skip to content

ungraceful handling of ctrl-c #63

@ErichBSchulz

Description

@ErichBSchulz

Issue

I was aborting a LM call I didn't want (more on that shortly). The aider behavior is normally to abort the call and advise that pressing ctrl c will terminate the app. This seems like desirable behavior.

Aider-ce printed a long error trace and threw me into bash.

Version and model info

Aider version: 0.88.1
Python version: 3.10.17
Platform: Linux-6.8.0-86-generic-x86_64-with-glibc2.39
Python implementation: CPython
Virtual environment: Yes
OS: Linux 6.8.0-86-generic (64bit)
Git version: git version 2.43.0

An uncaught exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 2608, in send
    async for chunk in self.show_send_output_stream(completion):
  File "base_coder.py", line 2703, in show_send_output_stream
    async for chunk in completion:
  File "streaming_handler.py", line 1801, in __anext__
    await self.fetch_stream()
  File "streaming_handler.py", line 1785, in fetch_stream
    self.completion_stream = await self.make_call(
  File "vertex_and_google_ai_studio_gemini.py", line 1775, in make_call
    response = await client.post(api_base, headers=headers, data=data, stream=True, logging_obj=logging_obj)
  File "logging_utils.py", line 190, in async_wrapper
    result = await func(*args, **kwargs)
  File "http_handler.py", line 315, in post
    response = await self.client.send(req, stream=stream)
  File "_client.py", line 1629, in send
    response = await self._send_handling_auth(
  File "_client.py", line 1657, in _send_handling_auth
    response = await self._send_handling_redirects(
  File "_client.py", line 1694, in _send_handling_redirects
    response = await self._send_single_request(request)
  File "_client.py", line 1730, in _send_single_request
    response = await transport.handle_async_request(request)
  File "aiohttp_transport.py", line 272, in handle_async_request
    response = await self._make_aiohttp_request(
  File "aiohttp_transport.py", line 239, in _make_aiohttp_request
    response = await client_session.request(
  File "client.py", line 1510, in __aenter__
    self._resp: _RetType = await self._coro
  File "client.py", line 779, in _request
    resp = await handler(req)
  File "client.py", line 757, in _connect_and_send_request
    await resp.start(conn)
  File "client_reqrep.py", line 539, in start
    message, payload = await protocol.read()  # type: ignore[union-attr]
  File "streams.py", line 680, in read
    await self._waiter
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "base_coder.py", line 1826, in send_message
    async for chunk in self.send(messages, tools=self.get_tool_list()):
  File "base_coder.py", line 2616, in send
    except LiteLLMExceptions().exceptions_tuple() as err:
TypeError: catching classes that do not inherit from BaseException is not allowed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "aider", line 10, in <module>
    sys.exit(main())
  File "main.py", line 474, in main
    return asyncio.run(main_async(argv, input, output, force_git_root, return_coder))
  File "runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "base_events.py", line 649, in run_until_complete
    return future.result()
  File "main.py", line 1212, in main_async
    await coder.run()
  File "base_coder.py", line 1068, in run
    return await self._run_patched(with_message, preproc)
  File "base_coder.py", line 1118, in _run_patched
    await processing_task
  File "base_coder.py", line 1175, in _processing_logic
    await self.run_one(user_message, preproc)
  File "base_coder.py", line 1231, in run_one
    async for _ in self.send_message(message):
  File "base_coder.py", line 1829, in send_message
    except litellm_ex.exceptions_tuple() as err:
TypeError: catching classes that do not inherit from BaseException is not allowed

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