Skip to content

Your lightweight open-source personal agent.

fix: only apply interim fallback when no tools were used

Nikolas de Hor45f33853cf95
diff --git a/nanobot/agent/loop.py b/nanobot/agent/loop.py
index d81781527..177302e78 100644
--- a/nanobot/agent/loop.py
+++ b/nanobot/agent/loop.py
@@ -245,7 +245,8 @@ class AgentLoop:
final_content = None
continue
# Fall back to interim content if retry produced nothing
- if not final_content and interim_content:
+ # and no tools were used (if tools ran, interim was truly interim)
+ if not final_content and interim_content and not tools_used:
final_content = interim_content
break