add check for fallback handler

This commit is contained in:
AI Christianson 2025-03-13 08:48:51 -04:00
parent f08e9455b6
commit c511cefc67
2 changed files with 3 additions and 2 deletions

View File

@ -825,7 +825,8 @@ class CiaynAgent:
try:
last_result = self._execute_tool(response)
self.chat_history.append(response)
self.fallback_handler.reset_fallback_handler()
if hasattr(self.fallback_handler, 'reset_fallback_handler'):
self.fallback_handler.reset_fallback_handler()
yield {}
except ToolExecutionError as e:

View File

@ -464,7 +464,7 @@ def run_agent_with_retry(
try:
_run_agent_stream(agent, msg_list)
if fallback_handler:
if fallback_handler and hasattr(fallback_handler, 'reset_fallback_handler'):
fallback_handler.reset_fallback_handler()
should_break, prompt, auto_test, test_attempts = (
_execute_test_command_wrapper(