From 41df8ee4f53b0447acb2da7c8684afa7d211efea Mon Sep 17 00:00:00 2001 From: teknium1 Date: Wed, 25 Feb 2026 03:45:47 -0800 Subject: [PATCH] refactor: enhance interrupt handling in AIAgent class - Updated the `clear_interrupt` method to also reset the global tool interrupt signal, improving the clarity of interrupt management within the agent. - This change ensures that all interrupt states are properly cleared, enhancing the reliability of the agent's operation. --- run_agent.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/run_agent.py b/run_agent.py index 5079dae19..942788813 100644 --- a/run_agent.py +++ b/run_agent.py @@ -971,9 +971,10 @@ class AIAgent: print(f"\n⚡ Interrupt requested" + (f": '{message[:40]}...'" if message and len(message) > 40 else f": '{message}'" if message else "")) def clear_interrupt(self) -> None: - """Clear any pending interrupt request.""" + """Clear any pending interrupt request and the global tool interrupt signal.""" self._interrupt_requested = False self._interrupt_message = None + _set_interrupt(False) def _hydrate_todo_store(self, history: List[Dict[str, Any]]) -> None: """