Skip to content

fix(client): notify plugins when requests are cancelled - #1532

Merged
Iwaniukooo11 merged 3 commits into
a2aproject:mainfrom
GoldArowana:fix/client-plugin-cancellation-20261126
Nov 27, 2026
Merged

Iwaniukooo11 merged 3 commits into
a2aproject:mainfrom
GoldArowana:fix/client-plugin-cancellation-20261126

Conversation

@GoldArowana

@GoldArowana GoldArowana commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

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 deliberate
aclose(). This can leave plugin request tracking unfinished or report an
interrupted stream as successful.

Report the original asyncio.CancelledError through the existing final
after_client_request hook and re-raise it to the caller. Explicitly closing
the stream still produces a successful final notification. The earlier
before-hook stage is covered separately in #1525.

Validation

  • The repository tests feed ConnectionError and asyncio.CancelledError through the same transport mock in get_task, send_message and subscribe. All three cancellation cases fail on the base, and the explicit-close control still checks error=None.
  • The Python 3.10 fork presubmit passed lint, type checks and the full pytest suite for 0cb5bda9. It passed 2,722 tests with 94.24% coverage.

@GoldArowana
GoldArowana requested a review from a team as a code owner November 26, 2026 15:49
@Iwaniukooo11 Iwaniukooo11 self-assigned this Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

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 Iwaniukooo11 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Iwaniukooo11
Iwaniukooo11 merged commit 4702c54 into a2aproject:main Nov 27, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants