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.
This commit is contained in:
teknium1
2026-02-25 03:45:47 -08:00
parent 6877d5f3b5
commit 41df8ee4f5

View File

@@ -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:
"""