From 56fd603723a6f188d0e62dd5d37623e10916d265 Mon Sep 17 00:00:00 2001 From: Eduardo Chiarotti Date: Fri, 19 Jul 2024 13:15:33 -0300 Subject: [PATCH] fix: agent missing fix (#966) --- src/crewai/task.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crewai/task.py b/src/crewai/task.py index 9e98adb1a..8b1a05ca0 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -213,8 +213,8 @@ class Task(BaseModel): tools: Optional[List[Any]], ) -> TaskOutput: """Run the core execution logic of the task.""" - self.agent = agent agent = agent or self.agent + self.agent = agent if not agent: raise Exception( f"The task '{self.description}' has no agent assigned, therefore it can't be executed directly and should be executed in a Crew using a specific process that support that, like hierarchical."