feat(fallback_handler.py): add console notification for tool fallback activation to improve user feedback during failures

This commit is contained in:
Ariel Frischer 2025-02-11 00:40:02 -08:00
parent 0521b3ff9a
commit 3d622911a6
1 changed files with 1 additions and 0 deletions

View File

@ -71,6 +71,7 @@ class FallbackHandler:
logger.error( logger.error(
f"Tool call failed {self.tool_failure_consecutive_failures} times. Attempting fallback to model: {fallback_model['model']} for tool: {failed_tool_call_name}" f"Tool call failed {self.tool_failure_consecutive_failures} times. Attempting fallback to model: {fallback_model['model']} for tool: {failed_tool_call_name}"
) )
Console().print(Panel(Markdown(f"**Tool fallback activated**: Switching to fallback model {fallback_model['model']} for tool {failed_tool_call_name}."), title="Fallback Notification"))
if fallback_model.get("type", "prompt").lower() == "fc": if fallback_model.get("type", "prompt").lower() == "fc":
self.attempt_fallback_function(code, logger, agent) self.attempt_fallback_function(code, logger, agent)
else: else: