mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 00:28:31 +00:00
fix: use consistent casefold().strip() comparison for add_image tool name
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 <joao@crewai.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user