fix(run): cancel sibling work after concurrent failures - #4185
Merged
Conversation
Co-authored-by: Pranav Mishra <mishrapranav82@gmail.com>
seratch
force-pushed
the
fix/run-sibling-cancellation
branch
from
August 5, 2026 01:08
90c384b to
53b0d37
Compare
4 tasks
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.
This pull request takes over the core fix proposed in #4142.
It ensures that when one SDK-owned concurrent run operation fails, its sibling operations are cancelled and drained before the original error is propagated. For parallel tool execution, it also carries the sibling-category failure signal into nested function-tool execution so existing bounded cleanup and post-invoke settlement behavior can complete while keeping parent cancellation prompt.
The implementation narrows the original approach by reusing the existing cancellation and function-tool lifecycle machinery without introducing global cancellation context or new public APIs. It preserves successful result ordering, streaming and non-streaming parity, and Python 3.10 compatibility.
The original contributor is credited through the commit's
Co-authored-bytrailer.