Skip to content

Bug: Async tasks (async_execution=True) receive empty context due to last_sync_output truncation #6417

Description

@Om-Borse26

Bug Description

Currently, tasks configured with async_execution=True do not receive the correct context from prior tasks.
In _execute_tasks (and _aexecute_tasks), the context for async tasks is generated using [last_sync_output] if last_sync_output else []. However, last_sync_output is only populated when resuming from a skipped/conditional task (in prepare_task_execution) and is otherwise None during a normal execution run.
As a result, async tasks receive a completely empty context and are unable to access the outputs of previous tasks in the pipeline.

Steps to Reproduce

See the reproduction script and execution logs in PR #6415.

Expected Behavior

Async tasks should receive the full task_outputs list passed to _get_context(), perfectly mirroring the behavior of synchronous tasks.

(Note: Authored with the assistance of an AI coding agent. Please apply the llm-generated label.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions