Fixes#3887
In hierarchical process, when a task was assigned to a specific agent,
the manager's delegation tools were only given access to that task's
assigned agent instead of all crew agents. This caused delegation
errors when trying to delegate to other agents in the crew.
Changes:
- Updated _update_manager_tools in crew.py to pass self.agents instead
of [task.agent] to _inject_delegation_tools
- Added comprehensive tests reproducing the bug scenario
- Updated existing test to reflect correct behavior where manager can
delegate to all crew agents
The fix ensures that in hierarchical mode, the manager agent can
delegate to any agent in the crew's agents list, not just the task's
assigned agent.
Co-Authored-By: João <joao@crewai.com>