From cff9cfb665bfaa1e1ad42b62b9cfc35d68073aa3 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 10:28:40 +0000 Subject: [PATCH] fix: use consistent casefold().strip() comparison for add_image tool name MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Address Bugbot feedback: ensure both tool_usage.py and crew_agent_executor.py use the same comparison approach (casefold().strip()) for detecting the add_image tool, preventing edge cases where fuzzy matching could cause inconsistent behavior. Co-Authored-By: João --- lib/crewai/src/crewai/tools/tool_usage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/crewai/src/crewai/tools/tool_usage.py b/lib/crewai/src/crewai/tools/tool_usage.py index 79f92ab75..df53f61a9 100644 --- a/lib/crewai/src/crewai/tools/tool_usage.py +++ b/lib/crewai/src/crewai/tools/tool_usage.py @@ -320,7 +320,8 @@ class ToolUsage: add_image_tool = self._i18n.tools("add_image") is_add_image_tool = ( isinstance(add_image_tool, dict) - and tool.name == add_image_tool.get("name", "") + and tool.name.casefold().strip() + == add_image_tool.get("name", "").casefold().strip() ) if not is_add_image_tool: result = self._format_result(result=result)