Skip to content

Commit

Permalink
passing cloned agents when copying context (#885)
Browse files Browse the repository at this point in the history
  • Loading branch information
WellyngtonF committed Jul 7, 2024
1 parent b75b0b5 commit 47f9d02
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/crewai/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]:
Expand Down

0 comments on commit 47f9d02

Please sign in to comment.