Repository navigation
fix(server): enforce A2A-Version on the REST and gRPC bindings - #443
Merged
muscariello merged 1 commit intoNov 2, 2026
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
muscariello
force-pushed
the
stack/04-a2a-version-rest-grpc
branch
from
November 2, 2026 12:02
7eb5bec to
fab84ab
Compare
Only the JSON-RPC binding read A2A-Version: HTTP+JSON and gRPC served a request with `A2A-Version: 99.0`, or with no version at all, as a 1.0 request, although 3.6.2 requires every interface to answer VersionNotSupportedError and to read an empty value as 0.3. The JSON-RPC check moves unchanged to middleware::check_a2a_version. rest_router runs it ahead of every route and, when the header is absent, reads the A2A-Version query parameter that 3.6.1 allows instead; GrpcHandler runs it on the metadata of every method. Both answer with the existing VERSION_NOT_SUPPORTED mapping (400 / FAILED_PRECONDITION). Tests that call the transports directly now send the version, as the JSON-RPC ones already do. Fixes: #410 Co-Authored-By: Claude Opus 5.5 <[email protected]> Signed-off-by: gulldan <[email protected]>
muscariello
force-pushed
the
stack/04-a2a-version-rest-grpc
branch
from
November 2, 2026 14:28
fab84ab to
6781b86
Compare
muscariello
changed the base branch from
stack/03-inmemory-task-store-limit
to
stack/03a-rest-error-media-type
November 2, 2026 15:01
msardara
approved these changes
Nov 2, 2026
Merged
This was referenced Nov 3, 2026
muscariello
added a commit
to gulldan/a2a-rs
that referenced
this pull request
Nov 3, 2026
§3.6.1 lets a client send A2A-Version as a request parameter instead of a header. The HTTP+JSON binding honors the query form since a2aproject#443; the JSON-RPC binding read only the header, so POST /?A2A-Version=1.0 without the header was refused with -32009 "version not supported: 0.3". The query fallback moves from rest.rs into middleware::add_query_version, which both HTTP bindings call before check_a2a_version. The header still wins when both are present. Signed-off-by: gulldan <[email protected]> Co-authored-by: Luca Muscariello <[email protected]>
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 #410. Replaces #411. Stacked on #455: review only the last commit.
Cause: only the JSON-RPC binding checked
A2A-Version. HTTP+JSON and gRPC served a request withA2A-Version: 99.0, or with no version, as a 1.0 request, although §3.6.2 requires every interface to answerVersionNotSupportedErrorand to read an empty value as 0.3.Fix:
check_a2a_versionmoves fromjsonrpc.rstomiddleware.rsand becomespub.rest_routerruns it in aroute_layerahead of every route, falling back to theA2A-Versionquery parameter (§3.6.1).GrpcHandlerruns it on the metadata of every method before dispatch. Rejections reuse the existing mappings:400/FAILED_PRECONDITIONwith reasonVERSION_NOT_SUPPORTED.Behavior change: a REST or gRPC client that sends no
A2A-Versionis now rejected, as JSON-RPC clients already are. Tests that call the transports directly now send1.0.Unproven: #411 says the a2a-python and a2a-go clients send the header on every transport, that #388 adds the same check on the 1.1 line, and reports an ITK 12/12 run. None of that was checked or run locally.