diff --git a/src/crewai/crew.py b/src/crewai/crew.py index d4b14e833..afa27b97a 100644 --- a/src/crewai/crew.py +++ b/src/crewai/crew.py @@ -1034,7 +1034,7 @@ class Crew(FlowTrackable, BaseModel): context = ( aggregate_raw_outputs_from_task_outputs(task_outputs) if task.context is NOT_SPECIFIED - else aggregate_raw_outputs_from_tasks(task.context) + else aggregate_raw_outputs_from_tasks(cast(List["Task"], task.context)) ) return context diff --git a/tests/test_task_context_type_annotation.py b/tests/test_task_context_type_annotation.py index ad4e22730..2eca3b99a 100644 --- a/tests/test_task_context_type_annotation.py +++ b/tests/test_task_context_type_annotation.py @@ -81,8 +81,8 @@ class TestTaskContextTypeAnnotation: task_with_empty_list = Task(description="Task 3", expected_output="Output 3", context=[]) assert task_with_not_specified.context is NOT_SPECIFIED - assert not (task_with_none.context is NOT_SPECIFIED) - assert not (task_with_empty_list.context is NOT_SPECIFIED) + assert task_with_none.context is not NOT_SPECIFIED + assert task_with_empty_list.context is not NOT_SPECIFIED def test_task_context_repr_shows_not_specified(self): """Test that NOT_SPECIFIED has a proper string representation."""