Skip to content

Fix type validation error in hierarchical process delegation (Issue #2606) #2607

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Conversation

devin-ai-integration[bot]
Copy link
Contributor

Fix type validation error in hierarchical process delegation

Fixes #2606

Description

This PR fixes the type validation error that occurs when using the hierarchical process delegation. The issue happens when a manager agent attempts to pass dictionary objects for task and context parameters, but the DelegateWorkToolSchema strictly requires string values.

Changes

  • Modified DelegateWorkToolSchema to accept both string and dictionary inputs
  • Updated _run method in DelegateWorkTool to handle both formats by converting dictionaries to strings
  • Added a test to verify the fix works with dictionary inputs

Testing

  • Added a new test specifically for dictionary inputs
  • Verified existing tests continue to pass
  • Tested the hierarchical process to ensure it works with the changes

Link to Devin run

https://app.devin.ai/sessions/6bb90d96c63343699562c0bed7990d67

Requested by: Joe Moura (joao@crewai.com)

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

@HaohanTsao
Copy link

HaohanTsao commented Apr 15, 2025

Wow I noticed Devin've already done after I opened a PR. I've also worked on a similar fix with some additional elements that might be helpful:

You can see my approach here: link

  1. Added comprehensive test cases that follow the existing tool testing style patterns used throughout the codebase
  2. Included more detailed documentation on the changes and their implications, and manually test.
  3. Thoroughly tested different input combinations (strings, dictionaries, mixed inputs, and edge cases)

If helpful, my contribution could serve as a reference for additional test coverage or documentation.

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.

[BUG]Type Error in Hierarchical Process Delegation
1 participant