Repository navigation
feat: Add plugin wrap call hooks - #1491
Open
Iwaniukooo11 wants to merge 7 commits into
Open
Iwaniukooo11 wants to merge 7 commits into
Iwaniukooo11 wants to merge 7 commits into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/client/base_client.py | 96.67% | 96.76% | 🟢 +0.09% |
| src/a2a/server/request_handlers/_plugin_hooks.py | 94.83% | 95.38% | 🟢 +0.56% |
| Total | 93.62% | 93.64% | 🟢 +0.02% |
Generated by coverage-comment.yml
Iwaniukooo11
force-pushed
the
mateusziwaniuk/feat/plugin-wrap-call-hooks
branch
from
November 18, 2026 10:34
a6957f3 to
318c02d
Compare
Iwaniukooo11
marked this pull request as ready for review
November 18, 2026 10:38
This branch has not been deployed
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.
Description
This PR introduces
wrap_server_callandwrap_client_calland mounts that intoclientandserverpluginsExample use-cases are caching and retyring
Change
wrap_client_callandwrap_server_call.base_client(_execute_with_interceptorsand_execute_stream_with_interceptors_plugin_hooks(stream_wrapperandunary_wrapper)_Endmark at the end of a stream to distinguish it fromNoneresponsePlease note that the approach used was with having
aclosing, not following the draft #1437.The reason is that closing shouldn't run plugin code - That could fail and mask the real error that is already propagating.
Tests
Added client and server tests:
Hook order on unary, streaming and error paths, nesting order, and a plugin that raises instead of calling.