Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

Fix for custom tools not being called by the agent

This PR fixes issue #2664 where custom tools are not being called by the crewAI agent in version 0.114.0, although they worked fine in version 0.108.0.

Root Cause

The issue was caused by changes to the ToolUsage class where the original_tools parameter was removed from the init method, but it's still being passed in the CrewAgentExecutor._execute_tool_and_check_finality method. Additionally, the way tools are selected has changed, with the original_tool variable being replaced with available_tool.

Solution

  1. Added back the original_tools parameter to the ToolUsage.init method
  2. Updated the _use method to check for original tools before falling back to available tools
  3. Added a test case that verifies custom tool invocation works correctly

Testing

Created a new test that validates custom tool invocation and ran the existing test suite to ensure no regressions.

Link to Devin run: https://app.devin.ai/sessions/6411214586c6443582443403bff127de
Requested by: Joe Moura (joao@crewai.com)

Co-Authored-By: Joe Moura <joao@crewai.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

devin-ai-integration bot and others added 6 commits April 22, 2025 16:38
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
Co-Authored-By: Joe Moura <joao@crewai.com>
@devin-ai-integration
Copy link
Contributor Author

Closing due to inactivity for more than 7 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant