Skip to content
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

[BUG] Training fails due to 'Manager agent should not have tools' #2131

Open
manni07 opened this issue Feb 14, 2025 · 3 comments · May be fixed by #2132
Open

[BUG] Training fails due to 'Manager agent should not have tools' #2131

manni07 opened this issue Feb 14, 2025 · 3 comments · May be fixed by #2132
Labels
bug Something isn't working

Comments

@manni07
Copy link

manni07 commented Feb 14, 2025

Description

The crew is running, doing its job and almost finished, final stage with last agent I get the following error message:

'
[2025-02-14 20:49:46][WARNING]: Manager agent should not have tools

[2025-02-14 20:49:46][ERROR]: Training failed: Manager agent should not have tools
Traceback (most recent call last):

...
'

Steps to Reproduce

  1. Start crew
  2. Wait up to the end
  3. Error message appears

Expected behavior

Finalizing task

Screenshots/Code snippets

All agents are defined like this:

@agent def jury(self) -> Agent: return Agent( config=self.agents_config['jury'], verbose=True, allow_delegation=True, temperature=0.7, memory=True, respect_context_window=True, )

The crew is

` @crew
def crew(self) -> Crew:
"""Creates the Mycrew crew"""

	return Crew(
		agents=self.agents,
		tasks=self.tasks, 
		verbose=True,
		manager_llm="gpt-4o",
		memory=True,
		process=Process.hierarchical
	)

`

Operating System

Ubuntu 24.04

Python Version

3.12

crewAI Version

0.102.0

crewAI Tools Version

latest

Virtual Environment

Venv

Evidence

`[2025-02-14 20:49:46][WARNING]: Manager agent should not have tools

[2025-02-14 20:49:46][ERROR]: Training failed: Manager agent should not have tools
Traceback (most recent call last):`

Possible Solution

None

Additional context

No available documentation

@manni07 manni07 added the bug Something isn't working label Feb 14, 2025
@manni07 manni07 changed the title [BUG] Training fails due to 'Manager agent should not have toolsÄ [BUG] Training fails due to 'Manager agent should not have tools' Feb 14, 2025
devin-ai-integration bot added a commit that referenced this issue Feb 14, 2025
- Add model validation to prevent tool assignment to manager agent
- Improve error handling in _create_manager_agent
- Add test to verify manager agent tools validation

Co-Authored-By: Joe Moura <[email protected]>
@Vidit-Ostwal
Copy link
Contributor

Can you share the entire code once.

@manni07
Copy link
Author

manni07 commented Feb 15, 2025

Here the entire crew.py:

`
from crewai import Agent, Crew, Process, Task
from crewai.project import CrewBase, agent, crew, task
import logging

logger = logging.getLogger(name)

@crewbase
class Mycrew():
"""Mycrew crew"""

def __init__(self):
	logger.debug("Initializing Mycrew")
	super().__init__()

agents_config = 'config/agents.yaml'
tasks_config = 'config/tasks.yaml'

@agent
def researcher(self) -> Agent:
	return Agent(
		config=self.agents_config['researcher'],
		verbose=True,
		allow_delegation=False
	)

@agent
def assistant(self) -> Agent:
	return Agent(
        config=self.agents_config['assistant'],
        verbose=True,
        allow_delegation=False,
        temperature=0.7,
        memory=False
	)

@agent
def publisher(self) -> Agent:
	return Agent(
		config=self.agents_config['publisher'],
		verbose=True,
		allow_delegation=False,
		temperature=0.7,
		memory=False
	)

@task
def research_task(self) -> Task:
	return Task(
		config=self.tasks_config['research_task']
	)

@task
def assistant_task(self) -> Task:
	return Task(
		config=self.tasks_config['assistant_task']
	)

@task
def publisher_task(self) -> Task:
	return Task(
		config=self.tasks_config['publisher_task'],
		agent=self.publisher(),
		memory=True,
		cache=True,
		output_file='report.md'
	)

@crew
def crew(self) -> Crew:
	"""Creates the Mycrew crew"""

	crew_instance = Crew(
		agents=self.agents, # Automatically created by the @agent decorator
		tasks=self.tasks, # Automatically created by the @task decorator
		verbose=True,
		manager_llm="gpt-4o",
		memory=True,
		process=Process.hierarchical
	)
	logger.info("Crew created successfully")
	return crew_instance

`

@manni07
Copy link
Author

manni07 commented Feb 15, 2025

Maybe of interest, it is repeatedly asking for a tool even though I did not specify:

`Processing training feedback.

Error parsing LLM output, agent will retry: I did it wrong. Invalid Format: I missed the 'Action:' after 'Thought:'. I will do right next, and don't use a tool I have already used.

If you don't need to use any more tools, you must give your best complete final answer, make sure it satisfies the expected criteria, use the EXACT format below:

Thought: I now can give a great answer
Final Answer: my best complete final answer to the task.`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants