From c080227751d8238301abbc2ac2837617d566e346 Mon Sep 17 00:00:00 2001 From: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 21:13:06 +0000 Subject: [PATCH] fix: Fix import sorting and type checking issues Co-Authored-By: Joe Moura --- src/crewai/crew.py | 7 ++++++- src/crewai/tools/agent_tools/agent_tools.py | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/crewai/crew.py b/src/crewai/crew.py index b817a757d..c4ddbd2fb 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -776,7 +776,12 @@ class Crew(BaseModel): ) # Track delegation in hierarchical process - if self.process == Process.hierarchical and task.agent and task.agent != self.manager_agent: + if ( + self.process == Process.hierarchical + and task.agent + and task.agent != self.manager_agent + and self.manager_agent + ): task.increment_delegations(self.manager_agent.role) task.processed_by_agents.add(self.manager_agent.role) self._logger.log( diff --git a/src/crewai/tools/agent_tools/agent_tools.py b/src/crewai/tools/agent_tools/agent_tools.py index dc4d913a5..3bf7d15c4 100644 --- a/src/crewai/tools/agent_tools/agent_tools.py +++ b/src/crewai/tools/agent_tools/agent_tools.py @@ -1,6 +1,7 @@ from crewai.agents.agent_builder.base_agent import BaseAgent from crewai.tools.base_tool import BaseTool from crewai.utilities import I18N, Logger + from .ask_question_tool import AskQuestionTool from .delegate_work_tool import DelegateWorkTool