mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-27 09:08:14 +00:00
Fix issue #2392: Preserve ConditionalTask type in Crew.copy() and kickoff_for_each()
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -641,7 +641,9 @@ class Task(BaseModel):
|
||||
cloned_agent = get_agent_by_role(self.agent.role) if self.agent else None
|
||||
cloned_tools = copy(self.tools) if self.tools else []
|
||||
|
||||
copied_task = Task(
|
||||
# Use the actual class of the instance being copied, not just Task
|
||||
task_class = self.__class__
|
||||
copied_task = task_class(
|
||||
**copied_data,
|
||||
context=cloned_context,
|
||||
agent=cloned_agent,
|
||||
|
||||
Reference in New Issue
Block a user