crewAI: [BUG] Manager agent repeatedly performs tasks

Description

My manager agent will take over and perform all the tasks themselves, if not, almost all tasks. I currently have the following in place:

  • Process is hierarchical
  • Assigned Task to specified agents (under the Task agent argument)
  • Emphasised in the manager backstory that they MUST NEVER perform the tasks themselves and only delegate work
  • LLM: gpt-4o, temperature=0.2

This happens regardless of whether I’d:

  • used a custom manager agent or activated manager_llm (under Crew definition)
  • set allow_delegation=True/False (under custom manager)
  • set planning=True/False (under Crew)

I’d appreciate any help from the community thank you!

Steps to Reproduce

Mentioned in description

Expected behavior

This wasn’t happening very much before when I had 2-3 agents. Currently, anything more than that will trigger the problem

Screenshots/Code snippets

NIL

Operating System

Windows 11

Python Version

3.10

crewAI Version

0.120.1

crewAI Tools Version

Same

Virtual Environment

Conda

Evidence

ERROR:crewai.telemetry.telemetry:('Connection aborted.', RemoteDisconnected('Remote end closed connection without response'))

# Agent: guardrailAgent
## Thought: Thought: I need to draft a message to the customer asking for the domain and IP address to assist them with their network issue.
## Using tool: Delegate work to coworker
## Tool Input: 
"{\"task\": {\"description\": \"Draft a friendly message to the customer asking for the domain name and IP address related to their network issue.\", \"type\": \"str\"}, \"context\": {\"description\": \"The customer reported a slow network but did not provide specific details like the domain or IP address.\", \"type\": \"str\"}, \"coworker\": \"responseAgent\"}"
## Tool Output: 

I encountered an error while trying to use the tool. This was the error: Arguments validation failed: 2 validation errors for DelegateWorkToolSchema
task
  Input should be a valid string [type=string_type, input_value={'description': 'Draft a ... issue.', 'type': 'str'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/string_type
context
  Input should be a valid string [type=string_type, input_value={'description': 'The cust...ddress.', 'type': 'str'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.8/v/string_type.
 Tool Delegate work to coworker accepts these inputs: Tool Name: Delegate work to coworker
Tool Arguments: {'task': {'description': 'The task to delegate', 'type': 'str'}, 'context': {'description': 'The context for the task', 'type': 'str'}, 'coworker': {'description': 'The role/name of the coworker to delegate to', 'type': 'str'}}
Tool Description: Delegate a specific task to one of the following coworkers: responseAgent
The input to this tool should be the coworker, the task you want them to do, and ALL necessary context to execute the task, they know nothing about the task, so share absolutely everything you know, don't reference things but instead explain them..
Moving on then. I MUST either use a tool (use one at time) OR give my best final answer not both at the same time. When responding, I must use the following format:

'''
Thought: you should always think about what to do
Action: the action to take, should be one of [Delegate work to coworker, Ask question to coworker]
Action Input: the input to the action, dictionary enclosed in curly braces
Observation: the result of the action
'''
This Thought/Action/Action Input/Result can repeat N times. Once I know the final answer, I must return the following format:

'''
Thought: I now can give a great answer
Final Answer: Your final answer must be the great and the most complete as possible, it must be outcome described

Possible Solution

None

Additional context

None but happy to respond where appropriate

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I am also facing this issue.

Hi there, this issue for me personally involved python notebooks - defining the agents+tasks in one cell and the crew+kickoff in another! Once I put them all in the same cell, it worked fine! Perhaps running it that way or in a py file might be better, hope this helps!