Skip to content

Conversation

@Rakshit-gen
Copy link

@Rakshit-gen Rakshit-gen commented Dec 20, 2025

Fixes #4137

When processing async tasks, _process_async_tasks returns a new list containing only async task outputs. The caller was replacing the existing task_outputs list instead of extending it, causing all previous sync task outputs to be silently lost.

Changed assignment (=) to extend() at all affected locations:

  • _execute_tasks() lines 1155, 1169
  • _aexecute_tasks() lines 960, 976
  • _handle_conditional_task() line 1182
  • _ahandle_conditional_task() line 990

This ensures sync task outputs accumulated before async tasks are preserved when async tasks are collected.


Note

Replaces overwriting of task_outputs with extend() when resolving async tasks to prevent loss of prior sync outputs in both sync and async execution paths, including conditional handlers.

  • Execution flow (crew.py)
    • Replace task_outputs = ..._process_async_tasks(...) with task_outputs.extend(...) in:
      • *_aexecute_tasks() and *_execute_tasks() when flushing pending async tasks mid-loop and at the end.
      • *_ahandle_conditional_task() and *_handle_conditional_task() before conditional evaluations.
    • Ensures previously accumulated sync outputs are preserved when mixing async and sync tasks and during conditional task handling.

Written by Cursor Bugbot for commit 5fcbc31. This will update automatically on new commits. Configure here.

Fixes crewAIInc#4137

When processing async tasks, `_process_async_tasks` returns a new list
containing only async task outputs. The caller was replacing the existing
`task_outputs` list instead of extending it, causing all previous sync
task outputs to be silently lost.

Changed assignment (`=`) to `extend()` at all affected locations:
- `_execute_tasks()` lines 1155, 1169
- `_aexecute_tasks()` lines 960, 976
- `_handle_conditional_task()` line 1182
- `_ahandle_conditional_task()` line 990

This ensures sync task outputs accumulated before async tasks are
preserved when async tasks are collected.
@Rakshit-gen
Copy link
Author

@gabemilani can we look into these changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant