Files
crewAI/lib/crewai/tests
Devin AI 029eedfddb fix: preserve task outputs when mixing sync and async tasks (#4137)
This fixes issue #4137 where task outputs were lost when a Crew executed
a mix of synchronous and asynchronous tasks. The bug was caused by
_process_async_tasks and _aprocess_async_tasks returning a new list,
which then replaced the existing task_outputs list instead of extending it.

Changes:
- Changed task_outputs = self._process_async_tasks(...) to
  task_outputs.extend(self._process_async_tasks(...)) in _execute_tasks
- Changed task_outputs = await self._aprocess_async_tasks(...) to
  task_outputs.extend(await self._aprocess_async_tasks(...)) in _aexecute_tasks
- Applied the same fix to _handle_conditional_task and _ahandle_conditional_task

Added tests:
- test_sync_task_outputs_preserved_when_mixing_sync_async_tasks
- test_sync_task_outputs_preserved_when_crew_ends_with_async_task
- test_sync_multiple_sync_tasks_before_async_all_preserved
- TestMixedSyncAsyncTaskOutputs class with async variants

Co-Authored-By: João <joao@crewai.com>
2025-12-20 15:09:38 +00:00
..
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-12-04 12:54:49 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-04 13:34:29 -08:00
2025-12-05 13:23:26 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-12-01 18:56:56 -05:00
2025-12-04 17:08:08 -05:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00
2025-10-20 14:10:19 -07:00