mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-09 16:18:30 +00:00
fix: Resolve critical bugs identified by Cursor Bugbot
- Fix task completion tracking to use task.output instead of non-existent task_id - Update callback validation to raise ValueError instead of PydanticCustomError - Refactor _execute_tasks to prevent task skipping and ensure all tasks execute exactly once - Maintain replay functionality compatibility with dynamic ordering - Remove undefined current_index variable reference Addresses all 3 bugs reported by automated analysis: 1. Task Skipping and Replay Breakage 2. Callback Validation Error Handling Mismatch 3. TaskOutput Missing task_id Causes Errors Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
@@ -29,9 +29,9 @@ def test_sequential_process_with_reverse_ordering(agents, tasks):
|
||||
execution_order = []
|
||||
|
||||
def reverse_ordering_callback(all_tasks, completed_outputs, current_index):
|
||||
completed_task_ids = {output.task_id for output in completed_outputs}
|
||||
completed_tasks = {id(task) for task in all_tasks if task.output is not None}
|
||||
remaining_indices = [i for i in range(len(all_tasks))
|
||||
if all_tasks[i].id not in completed_task_ids]
|
||||
if id(all_tasks[i]) not in completed_tasks]
|
||||
if remaining_indices:
|
||||
next_index = max(remaining_indices)
|
||||
execution_order.append(next_index)
|
||||
@@ -62,10 +62,10 @@ def test_hierarchical_process_with_priority_ordering(agents, tasks):
|
||||
execution_order = []
|
||||
|
||||
def priority_ordering_callback(all_tasks, completed_outputs, current_index):
|
||||
completed_task_ids = {output.task_id for output in completed_outputs}
|
||||
completed_tasks = {id(task) for task in all_tasks if task.output is not None}
|
||||
remaining_tasks = [
|
||||
(i, task) for i, task in enumerate(all_tasks)
|
||||
if task.id not in completed_task_ids
|
||||
if id(task) not in completed_tasks
|
||||
]
|
||||
|
||||
if remaining_tasks:
|
||||
|
||||
Reference in New Issue
Block a user