Description
What happened?
On main (73d3698; a2a-server-lf 0.5.3, a2a-grpc 0.3.11) only the JSON-RPC binding checks A2A-Version: check_a2a_version, called at jsonrpc.rs#L76. a2a-server/src/rest.rs and a2a-grpc/src/server.rs never call it, so a request with A2A-Version: 99.0, or with no version, runs as a 1.0 request. A2A v1.0.1 §3.6.2 applies to every interface: an unsupported version MUST get VersionNotSupportedError, and an empty value is 0.3.
Reproduce with the repository's own example, from the repository root:
cargo run --bin helloworld-server --package examplesMSG='{"message":{"messageId":"m1","role":"ROLE_USER","parts":[{"text":"hi"}]}}'
# JSON-RPC
curl -s localhost:3000/jsonrpc -H 'Content-Type: application/json' -H 'A2A-Version: 99.0' \
-d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"SendMessage\",\"params\":$MSG}"
# HTTP+JSON
curl -s -w '\nHTTP %{http_code}\n' localhost:3000/rest/message:send \
-H 'Content-Type: application/json' -H 'A2A-Version: 99.0' -d "$MSG"
# gRPC
grpcurl -plaintext -import-path a2a-pb/proto -proto a2a.proto -H 'a2a-version: 99.0' \
-d "$MSG" localhost:50051 lf.a2a.v1.A2AService/SendMessageA2A-Version: 99.0 |
no A2A-Version |
|
|---|---|---|
| JSON-RPC | -32009 "version not supported: 99.0" |
-32009 "version not supported: 0.3" |
| HTTP+JSON | 200, task TASK_STATE_COMPLETED |
200, task TASK_STATE_COMPLETED |
| gRPC | OK, task TASK_STATE_COMPLETED |
OK, task TASK_STATE_COMPLETED |
Expected on HTTP+JSON and gRPC: what -32009 maps to in §5.4 — 400 and FAILED_PRECONDITION, ErrorInfo reason VERSION_NOT_SUPPORTED.
Found with the A2A TCK: VER-SERVER-002 [http_json] and GRPC-ERR-002 (version).
Related: #271 asked for the check on REST as well; #281 added it to JSON-RPC. The draft 1.1 stack does it on every binding (#388), but main and the current releases don't have it; #388 reads only the header, so ?A2A-Version=1.0, which §3.6.1 allows, gets 400 there. A small fix for main follows in a PR.
Relevant log output
# JSON-RPC
{"jsonrpc":"2.0","id":1,"error":{"code":-32009,"message":"version not supported: 99.0","data":[{"@type":"type.googleapis.com/google.rpc.ErrorInfo","domain":"a2a-protocol.org","metadata":{"timestamp":"…"},"reason":"VERSION_NOT_SUPPORTED"}]}}
# HTTP+JSON
{"task":{"contextId":"…","id":"…","status":{"message":{…,"parts":[{"text":"Echo: hi"}],"role":"ROLE_AGENT",…},"state":"TASK_STATE_COMPLETED",…}}}
HTTP 200
# gRPC
{
"task": {
"id": "…",
"status": {
"state": "TASK_STATE_COMPLETED",
…Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
fix(server): enforce A2A-Version on the REST and gRPC bindings
fix(server): enforce A2A-Version on the REST and gRPC bindings (a2apr…