Repository navigation
Conversation
The JSON-RPC transport never looked at the status of a response. An
error that something in front of the agent answers itself (an
authenticating proxy's 401, a gateway's 429 or 502) carries no
JSON-RPC envelope, so the caller got "failed to parse JSON-RPC
response" and could not tell a credential or rate-limit problem from
a broken server. A streaming call answered that way without a content
type was handed to the SSE parser and came back as an empty stream.
A body that is not a JSON-RPC envelope is now reported with its
status, as the REST transport already does ("HTTP 429 Too Many
Requests: <body>"); a JSON-RPC envelope is still decoded whatever the
status, and a non-success status is never treated as a stream.
Fixes: a2aproject#404
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
The streaming test matched on the result and panicked in an `Ok` arm that a passing run never reaches, so that line stayed uncovered. Taking the error with `.err().expect()` keeps the assertion and needs no `Debug` on the stream. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
google.protobuf.Value carries every number as a double, and
proto_value_to_json_value turned each one back into a JSON float, so
an integer in a data part or in metadata reached the executor, and a
client's decoded response, as 3600.0. serde then refuses it for an
integer type ("invalid type: floating point `3600.0`, expected u32").
A whole number within +-2^53, where a double is exact, is now given
back as an integer; other numbers stay floats. The round-trip tests
that used floats to work around this now use integers, and a new
protojson test decodes a JSON-RPC SendMessage whose data part holds an
integer and deserializes it into u32.
Fixes: a2aproject#399
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
InMemoryTaskStore never removed a task, and TaskStore has no delete, so a long-running agent kept every task it ever served: 20,000 tasks with a 4 KiB artifact each held 192 MiB. InMemoryTaskStore::with_terminal_task_limit(n) keeps at most n tasks in a terminal state and purges the one that reached its terminal state earliest. Tasks that are not terminal are never purged, and a purged task reads as TaskNotFoundError, which A2A 3.3.2 allows for a task that was completed and purged. new() keeps every task, as before. With a limit of 1,000 the same run stays at about 20 MiB. Fixes: a2aproject#401 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
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: a2aproject#410 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: gulldan <5641375+gulldan@users.noreply.github.com>
gulldan
force-pushed
the
fix/a2a-version-rest-grpc
branch
from
October 31, 2026 19:44
45f6205 to
844bfb6
Compare
This was referenced Oct 31, 2026
Member
|
Superseded by #443, which carries the same commit on an in-repo branch so the stack can be reviewed one commit at a time. |
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.
Problem
Only the JSON-RPC binding read
A2A-Version. HTTP+JSON and gRPC ran a request withA2A-Version: 99.0, or with no version at all, 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 unchanged fromjsonrpc.rstomiddleware.rsand becomespub, where the A2A 1.1 stack (feat(server)!: add live exchanges with a shared execution runtime #388) also puts it. JSON-RPC behaves exactly as before.rest_routerruns it in aroute_layerahead of every REST route. When the header is absent it reads theA2A-Versionquery parameter, which §3.6.1 lets a client send instead (a2a-go'snewHTTPServiceParamsdoes the same). A rejection uses the existing mapping:400,FAILED_PRECONDITION,ErrorInforeasonVERSION_NOT_SUPPORTED.GrpcHandlerruns it on the metadata of all 11 methods before dispatch:FAILED_PRECONDITIONwith the sameErrorInfo.RestTransport,GrpcTransportorrest_routerdirectly now sendA2A-Version: 1.0, as fix(a2a-server): fix several SHOULD/MAY-level ACTS conformance gaps #302 did for the JSON-RPC ones.A2AClientalready sends it by default.Behavior change: a REST or gRPC client that sends no
A2A-Versionis now rejected as 0.3, as JSON-RPC clients have been since #302. The a2a-python and a2a-go clients onmainsend it on every transport.Tests
rest::tests::test_unsupported_a2a_version_is_rejected(99.0),test_missing_a2a_version_is_rejected(no version, onSendMessageand onGET /tasks/{id}),test_a2a_version_query_parameter_is_accepted(?A2A-Version=1.0accepted,?A2A-Version=99.0rejected).a2a-grpce2egrpc_transport_rejects_unsupported_a2a_version:SendMessageandSendStreamingMessagewith99.0and with no version getVERSION_NOT_SUPPORTEDthroughGrpcTransport.400FAILED_PRECONDITION"version not supported: 99.0" / "…: 0.3", gRPCFailedPreconditionwith the same messages,1.0served on all three.cargo metadata --locked,cargo hack check --all-targets --each-feature,cargo fmt --check,cargo hack clippy --all-targets --each-feature -- -D warnings,cargo test --workspace --exclude itk-rust-current-agent, copyright headers — all green (842 tests).run_itk.sh, a2a-itk main d53108a): 12/12 passed — send message, push notification and resubscribe over JSON-RPC, gRPC and HTTP+JSON, againstpython_v10,go_v10andrust_v10in both directions.Overlap with the A2A 1.1 stack
#388 adds the same check to REST, gRPC and SLIMRPC on the 1.1 line; this is the 1.0-line change for
mainand the current releases. Names follow #388 (middleware::check_a2a_version,validate_protocol_versioninrest.rsandserver.rs), so when the stack rebases the conflicts in those files resolve by taking the stack's side. One difference: #388's REST layer reads only the header, soPOST /rest/message:send?A2A-Version=1.0with no header gets400there and200here. SLIMRPC is left to #388.🤖 Generated with Claude Code