From 33ece82e08b254a0ed6cb020a4bf5d107ffe6c10 Mon Sep 17 00:00:00 2001 From: WellyngtonF <59291417+WellyngtonF@users.noreply.github.com> Date: Sun, 7 Jul 2024 12:58:38 -0300 Subject: [PATCH] passing cloned agents when copying context (#885) --- 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 4071bb703..9b54bf9f4 100644 --- a/src/crewai/task.py +++ b/src/crewai/task.py @@ -291,7 +291,7 @@ class Task(BaseModel): 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]: