fix: preserve task outputs across async batch flush#5698
Merged
greysonlalonde merged 2 commits intoMay 4, 2026
Conversation
iris-clawd
approved these changes
May 4, 2026
Contributor
iris-clawd
left a comment
There was a problem hiding this comment.
Classic = vs .extend() bug — rebinding the local task_outputs instead of appending to the existing list. All six call sites fixed consistently. Tests cover the three key scenarios (sync path, async path, conditional flush) and assert the output ordering is preserved.
LGTM ✅
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4137. Replaces #4139 with regression tests added.
_process_async_tasks/_aprocess_async_tasksreturn a new list, so the six call sites that didtask_outputs = self._process_async_tasks(...)were overwriting any sync outputs already accumulated. For[sync, async, sync]the leading sync output was silently dropped. The conditional handlers had a related issue: rebinding thetask_outputsparameter discarded the async batch entirely.Switches all six call sites from
=to.extend(). Adds three regression tests covering the sync path, the native-async path (akickoff), and the conditional-task path. All three fail without the fix.Note
Medium Risk
Touches core task-execution aggregation logic in both sync and native-async paths; a mistake could reorder or omit task outputs and affect downstream context/conditional behavior.
Overview
Fixes a regression where flushing pending async tasks (
_process_async_tasks/_aprocess_async_tasks) could overwrite previously collectedtask_outputs, causing earlier sync outputs (and sometimes async outputs during conditional evaluation) to be dropped.All affected call sites now append via
task_outputs.extend(...)instead of rebinding the list, and new tests assert correct output preservation/order for mixed sync+async execution (kickoff), native async (akickoff), and when aConditionalTaskforces an async flush.Reviewed by Cursor Bugbot for commit aa859ac. Bugbot is set up for automated code reviews on this repo. Configure here.