@@ -1456,6 +1456,8 @@ def get_response(
14561456 )
14571457 if should_break :
14581458 final_response_text = tool_summary_text
1459+ # Reset interaction_displayed to ensure final summary is shown
1460+ interaction_displayed = False
14591461 break
14601462 elif tool_summary_text is None and iteration_count > self .OLLAMA_SUMMARY_ITERATION_THRESHOLD :
14611463 # Continue iteration after adding final answer prompt
@@ -1485,6 +1487,8 @@ def get_response(
14851487 tool_summary = self ._generate_ollama_tool_summary (accumulated_tool_results , response_text )
14861488 if tool_summary :
14871489 final_response_text = tool_summary
1490+ # Reset interaction_displayed to ensure final summary is shown
1491+ interaction_displayed = False
14881492 break
14891493
14901494 # If we've executed tools in previous iterations, this response contains the final answer
@@ -2567,6 +2571,8 @@ async def get_response_async(
25672571 )
25682572 if should_break :
25692573 final_response_text = tool_summary_text
2574+ # Reset interaction_displayed to ensure final summary is shown
2575+ interaction_displayed = False
25702576 break
25712577 elif tool_summary_text is None and iteration_count > self .OLLAMA_SUMMARY_ITERATION_THRESHOLD :
25722578 # Continue iteration after adding final answer prompt
@@ -2594,6 +2600,8 @@ async def get_response_async(
25942600 tool_summary = self ._generate_ollama_tool_summary (accumulated_tool_results , response_text )
25952601 if tool_summary :
25962602 final_response_text = tool_summary
2603+ # Reset interaction_displayed to ensure final summary is shown
2604+ interaction_displayed = False
25972605 break
25982606
25992607 # If we've executed tools in previous iterations, this response contains the final answer
0 commit comments