Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions cecli/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -1378,6 +1378,11 @@ async def simple_send_with_retries(
continue
except AttributeError:
return None
except KeyboardInterrupt:
# An interrupt was not caught within the async run loop.
# We'll just pass to allow the thread to exit gracefully
# without a scary traceback.
pass

def model_error_response(self):
return litellm.ModelResponse(
Expand Down
12 changes: 3 additions & 9 deletions cecli/tui/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ def _run_thread(self):

try:
self.loop.run_until_complete(self._async_run())
except asyncio.CancelledError:
pass
except RuntimeError:
# Event loop stopped - this is expected during shutdown
except BaseException:
# Catch anything that could bring down the thread, and just let it exit.
# This includes KeyboardInterrupt, SystemExit, etc.
pass
finally:
self._cleanup_loop()
Expand Down Expand Up @@ -188,11 +187,6 @@ def stop(self):
# We'll just pass to allow the thread to exit gracefully
# without a scary traceback.
pass
except KeyboardInterrupt:
# An interrupt was not caught within the async run loop.
# We'll just pass to allow the thread to exit gracefully
# without a scary traceback.
pass
self.interrupt()

# Wait for thread to finish
Expand Down
Loading