fix: Catch BaseException in worker thread to prevent tracebacks on interruption#540
Open
szmania wants to merge 2 commits into
Open
fix: Catch BaseException in worker thread to prevent tracebacks on interruption#540szmania wants to merge 2 commits into
szmania wants to merge 2 commits into
Conversation
added 2 commits
May 27, 2026 11:12
Co-authored-by: cecli (openai/gemini_cli_local/gemini-2.5-pro)
Author
|
@dwash96 This PR is in draft and should remain so until at least 4 more days of testing have passed to confirm the interruption exception issue no longer occurs. Please do not merge until the testing window is complete. |
Author
|
@dwash96 I've been using this for 3 days incessantly, seems to have fixed the issue. setting to ready for merge |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an issue where
KeyboardInterruptexceptions during async completion calls would produce ugly tracebacks and potentially crash the TUI worker thread.Changes
cecli/tui/worker.pyCoderWorker.run()to catchBaseExceptioninstead of onlyasyncio.CancelledErrorandRuntimeError. This ensuresKeyboardInterrupt,SystemExit, and any other unexpected exceptions don't crash the worker thread.except KeyboardInterruptblock in_async_run()since the outerBaseExceptioncatch inrun()already handles it.cecli/models.pyexcept KeyboardInterrupthandler in the model's async completion loop to gracefully exit without a traceback when an interrupt occurs mid-request.Related Issues