Skip to content

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix DirectorySearchTool parameter mismatch issue #3570

Summary

Fixes a parameter name mismatch between DirectorySearchTool._run() and its parent RagTool._run() method that caused runtime errors when DirectorySearchTool was called by the CrewAI framework.

Root Cause:

  • RagTool._run() expects parameter: query: str
  • DirectorySearchTool._run() expected parameter: search_query: str
  • When CrewAI framework called the tool with query, it failed with "unexpected keyword argument 'query'"

Solution:

  • Modified DirectorySearchTool._run() to accept both query and search_query parameters
  • Added validation to ensure at least one parameter is provided
  • search_query takes priority when both are provided (for backward compatibility)
  • Added comprehensive tests covering both calling patterns

Review & Testing Checklist for Human

  • End-to-end integration test: Verify DirectorySearchTool works correctly when called by CrewAI framework with query parameter
  • Schema validation compatibility: Confirm that input schema validation still works correctly despite method signature changes
  • Backward compatibility: Test that existing code using search_query parameter continues to work without changes
  • Error handling: Verify the error message when neither parameter is provided is clear and helpful

Notes

Testing limitations: Full test suite had API connection failures unrelated to this change, but the specific fix was verified through:

  • Reproduction script showing Test 3 now passes (was failing before)
  • New parameter compatibility tests pass
  • Parameter priority tests pass

Related tools: Found that DOCXSearchTool and WebsiteSearchTool have similar parameter mismatches, but only fixed DirectorySearchTool as specified in issue #3570.

Link to Devin run: https://app.devin.ai/sessions/affecbf310ec4e578ef27694bfd76b73
Requested by: João ([email protected])

- Accept both 'query' and 'search_query' parameters for compatibility
- Prioritize 'search_query' for backward compatibility
- Add comprehensive tests covering both calling patterns
- Fixes CrewAI framework calls that use 'query' parameter

Co-Authored-By: João <[email protected]>
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

Copy link

cursor bot commented Sep 21, 2025

You have run out of free Bugbot PR reviews for this billing cycle. This will reset on September 28.

To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link
Contributor Author

Closing due to inactivity for more than 7 days. Configure here.

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.

0 participants