diff --git a/src/crewai/task.py b/src/crewai/task.py index 4071bb7030..9b54bf9f47 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -291,7 +291,7 @@ def copy(self, agents: Optional[List["BaseAgent"]] = None) -> "Task": # type: i copied_data = {k: v for k, v in copied_data.items() if v is not None} cloned_context = ( - [task.copy() for task in self.context] if self.context else None + [task.copy(agents) for task in self.context] if self.context else None ) def get_agent_by_role(role: str) -> Union["BaseAgent", None]: