Skip to content

Commit 3982e61

Browse files
authored
Merge pull request #523 from szmania/cli-29-fix-hang
CLI-29: Robust Interruption in Agent Mode + Various Fixes
2 parents 46787fc + 0bcb072 commit 3982e61

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

cecli/tui/worker.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ async def _async_run(self):
9292
break # Normal exit
9393
except asyncio.CancelledError:
9494
break
95+
except KeyboardInterrupt:
96+
continue
9597
except SwitchCoderSignal as switch:
9698
# Handle chat mode switches (e.g., /chat-mode architect)
9799
try:
@@ -179,7 +181,11 @@ def stop(self):
179181
except RuntimeError:
180182
# Loop may already be closed
181183
pass
182-
184+
except KeyboardInterrupt:
185+
# An interrupt was not caught within the async run loop.
186+
# We'll just pass to allow the thread to exit gracefully
187+
# without a scary traceback.
188+
pass
183189
self.interrupt()
184190

185191
# Wait for thread to finish

0 commit comments

Comments
 (0)