Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] kickoff_for_each copies ConditionalTask as Task #2392

Closed
Yun-Kim opened this issue Mar 17, 2025 · 1 comment · Fixed by #2461
Closed

[BUG] kickoff_for_each copies ConditionalTask as Task #2392

Yun-Kim opened this issue Mar 17, 2025 · 1 comment · Fixed by #2461
Assignees
Labels
bug Something isn't working

Comments

@Yun-Kim
Copy link

Yun-Kim commented Mar 17, 2025

Description

Follow up on #1629 as it was not addressed. It looks like when Crew.kickoff_for_each() is called for a crew that contains ConditionalTask items, the copied crews cast the ConditionalTask as a Task instead. As a result conditional task crews are broken when running with kickoff_for_each().

Steps to Reproduce

  1. Create a crew with a conditional task
  2. Run crew.kickoff_for_each(inputs=[...])
  3. See that conditional tasks are always run and can be debugged to return type=Task, not type=ConditionalTask

Expected behavior

ConditionalTask items should be copied as ConditionalTasks, not Tasks.

Screenshots/Code snippets

N/A

Operating System

Ubuntu 20.04

Python Version

3.10

crewAI Version

0.102.0

crewAI Tools Version

N/A

Virtual Environment

Venv

Evidence

https://github.com/crewAIInc/crewAI/blob/main/src/crewai/task.py#L644-L649 should be pretty evident that we're missing type handling.

Possible Solution

Add type handling when copying tasks.

Additional context

N/A

@lucasgomide
Copy link
Contributor

Hey @Yun-Kim, it’s been merged! The fix should be available in the next release. Ty for reporting that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants