fix: only apply interim fallback when no tools were used
Addresses Codex review: if the model sent interim text then used tools, the interim text should not be used as fallback for the final response.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user