Repository navigation
fix(client): notify plugins when requests are cancelled - #1532
Merged
Iwaniukooo11 merged 3 commits intoNov 27, 2026
Merged
Iwaniukooo11 merged 3 commits into
Iwaniukooo11 merged 3 commits into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/server/cluster/database_event_stream.py | 93.64% | 97.27% | 🟢 +3.64% |
| Total | 94.12% | 94.16% | 🟢 +0.04% |
Generated by coverage-comment.yml
Iwaniukooo11
requested changes
Nov 26, 2026
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.
What changes
A client plugin can miss the terminal notification when the caller cancels a
unary request. When the caller cancels an in-flight stream read, the terminal
notification currently has
error=None, the same value as a deliberateaclose(). This can leave plugin request tracking unfinished or report aninterrupted stream as successful.
Report the original
asyncio.CancelledErrorthrough the existing finalafter_client_requesthook and re-raise it to the caller. Explicitly closingthe stream still produces a successful final notification. The earlier
before-hook stage is covered separately in #1525.
Validation
ConnectionErrorandasyncio.CancelledErrorthrough the same transport mock inget_task,send_messageandsubscribe. All three cancellation cases fail on the base, and the explicit-close control still checkserror=None.0cb5bda9. It passed 2,722 tests with 94.24% coverage.