Fix tool_utils to pass original_tools to ToolUsage

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-04-22 16:49:23 +00:00
parent 6dc8c1ad74
commit c7d126ade0
2 changed files with 7 additions and 2 deletions

View File

@@ -60,6 +60,7 @@ def execute_tool_and_check_finality(
task=task,
agent=agent,
action=agent_action,
original_tools=tools, # Pass original tools to ensure custom tools work
)
# Parse tool calling

View File

@@ -57,12 +57,16 @@ def test_custom_tool_invocation():
)
i18n = I18N()
mock_agent.key = "test_agent"
mock_agent.role = "test_role"
result = execute_tool_and_check_finality(
agent_action=action,
tools=[custom_tool],
i18n=i18n,
agent_key=mock_agent.key if hasattr(mock_agent, "key") else None,
agent_role=mock_agent.role if hasattr(mock_agent, "role") else None,
agent_key=mock_agent.key,
agent_role=mock_agent.role,
tools_handler=tools_handler,
task=mock_task,
agent=mock_agent,