Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/crewai/src/crewai/crew.py
Original file line number Diff line number Diff line change
Expand Up @@ -957,9 +957,9 @@ async def _aexecute_tasks(
pending_tasks.append((task, async_task, task_index))
else:
if pending_tasks:
task_outputs = await self._aprocess_async_tasks(
task_outputs.extend(await self._aprocess_async_tasks(
pending_tasks, was_replayed
)
))
pending_tasks.clear()

context = self._get_context(task, task_outputs)
Expand All @@ -973,7 +973,7 @@ async def _aexecute_tasks(
self._store_execution_log(task, task_output, task_index, was_replayed)

if pending_tasks:
task_outputs = await self._aprocess_async_tasks(pending_tasks, was_replayed)
task_outputs.extend(await self._aprocess_async_tasks(pending_tasks, was_replayed))

return self._create_crew_output(task_outputs)

Expand All @@ -987,7 +987,7 @@ async def _ahandle_conditional_task(
) -> TaskOutput | None:
"""Handle conditional task evaluation using native async."""
if pending_tasks:
task_outputs = await self._aprocess_async_tasks(pending_tasks, was_replayed)
task_outputs.extend(await self._aprocess_async_tasks(pending_tasks, was_replayed))
pending_tasks.clear()

return check_conditional_skip(
Expand Down Expand Up @@ -1152,7 +1152,7 @@ def _execute_tasks(
futures.append((task, future, task_index))
else:
if futures:
task_outputs = self._process_async_tasks(futures, was_replayed)
task_outputs.extend(self._process_async_tasks(futures, was_replayed))
futures.clear()

context = self._get_context(task, task_outputs)
Expand All @@ -1166,7 +1166,7 @@ def _execute_tasks(
self._store_execution_log(task, task_output, task_index, was_replayed)

if futures:
task_outputs = self._process_async_tasks(futures, was_replayed)
task_outputs.extend(self._process_async_tasks(futures, was_replayed))

return self._create_crew_output(task_outputs)

Expand All @@ -1179,7 +1179,7 @@ def _handle_conditional_task(
was_replayed: bool,
) -> TaskOutput | None:
if futures:
task_outputs = self._process_async_tasks(futures, was_replayed)
task_outputs.extend(self._process_async_tasks(futures, was_replayed))
futures.clear()

return check_conditional_skip(
Expand Down