From 570977acf86698c6c19220854008039734fef692 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Mon, 24 Feb 2025 13:16:55 +0000 Subject: [PATCH] fix: handle None arguments in tool usage check Co-Authored-By: Joe Moura --- src/crewai/tools/tool_usage.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crewai/tools/tool_usage.py b/src/crewai/tools/tool_usage.py index ee167350c..703baf76a 100644 --- a/src/crewai/tools/tool_usage.py +++ b/src/crewai/tools/tool_usage.py @@ -288,7 +288,8 @@ class ToolUsage: return False if last_tool_usage := self.tools_handler.last_used_tool: # For WebSocket tools, we need to check if the question is the same - if "question" in calling.arguments and "question" in last_tool_usage.arguments: + if (calling.arguments is not None and last_tool_usage.arguments is not None and + "question" in calling.arguments and "question" in last_tool_usage.arguments): return ( calling.tool_name == last_tool_usage.tool_name and calling.arguments["question"] == last_tool_usage.arguments["question"]