Add comment explaining tool result duplication fix

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-09 08:05:17 +00:00
parent d8876dc3bf
commit f9221ea636

View File

@@ -214,6 +214,9 @@ def handle_agent_action_core(
if show_logs:
show_logs(formatted_answer)
# Tool results are already included in the formatted answer with "Observation:" prefix,
# so we don't need to append them again to messages to avoid duplication and token bloat.
# This fixes issue #2798 where tool results were being duplicated in the LLM prompt.
return formatted_answer