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 <[email protected]>
Signed-off-by: gulldan <[email protected]>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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 <[email protected]> Signed-off-by: gulldan <[email protected]>
|
@gulldan thank you for all these fixes. Thanks again for your contribution. |
|
Thank you, @muscariello, for the kind words, and for reviewing and merging #408 and approving #409 so quickly. Understood about the build queue. I kept one PR per issue so each fix could be reviewed and reverted on its own, but I didn't realise each one costs a full CI run. From now on I'll send related fixes as a stack: one commit per issue, each PR on top of the previous one. For the ones still open (#405, #406, #407, #411): would you like me to restack them into a single chain, or leave them as they are to avoid another round of builds? Happy to do whichever is easier for you. Thanks again for maintaining a2a-rs and for the careful reviews. |
|
Keep one issue per PR. That's perfect. Just stack them because at every merge we get a rebse. |
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 <[email protected]>
Signed-off-by: gulldan <[email protected]>
0d6f660 to
9e749f4
Compare
|
to create a Github stack you must use the PR window and stack them by clicking in the top right corner or use gh cli to do that. |
|
Thanks, @muscariello. I tried both ways before replying, and unfortunately I can't do it from my side: these PRs come from my fork, and GitHub doesn't support stacks across forks. The docs say: "Stacked pull requests require all branches to be in the same repository. Cross-fork stacks are not supported." What I got:
Nothing changed on the PRs; all five still target I'm not asking for write access: granting it to an outside contributor just for this wouldn't be a good idea. So the options I see:
Whichever is easier for you. If there's a way to stack PRs from a fork that I've missed, I'd be glad to learn it. |
|
This is gonna take a long time to review because the CI will take much longer. |
|
Thanks, @muscariello — and sorry: after your comment I opened more PRs today (#414–#438), which made the CI load worse, not better. Since a native stack can't be built from a fork, here is how I'd like to reduce the load, if it works for you:
Alternatives, if you prefer:
If some of these fixes matter more to you than others, or overlap with the 1.1 stack you're working on, tell me which to send first or drop. I'll go in that order. I won't open anything new until we've agreed on the approach. |
|
let me move all the branches into the remove myself. Hold on for one day please. |
|
Superseded by #440, which carries the same commit on an in-repo branch so the stack can be reviewed one commit at a time. |
Fixes #399.
Problem
google.protobuf.Valuecarries every number as a double, andproto_value_to_json_valueturned each one back into a JSON float withserde_json::Number::from_f64. Every binding decodes through it, so an integer in adatapart or inmetadatareached theAgentExecutor— and a client's decoded responses — as3600.0, andserde_json::from_value::<u32>refused it.Fix
A whole number within ±2^53, where a double is exact, is given back as an integer (
json_numberinpbconv.rs); fractions, larger magnitudes and the non-finite case behave as before. Only the decodedserde_json::Valuechanges; the protojson wire form is untouched.Tests
integers_in_data_parts_stay_integers(a2a-pb/tests/protojson.rs): decodes a JSON-RPCSendMessagewhose data part is{"sinceSeconds": 3600, "ratio": 0.5}and deserializessinceSecondsintou32. Onmainit fails withinvalid type: floating point3600.0, expected u32.test_struct_roundtripandtest_part_data_roundtripused floats to work around this ("since proto Value stores all numbers as f64"); they now round-trip integers, a negative integer and a fraction.protojson_roundtripfuzz target checks idempotence, which still holds: an integral double reaches its integer form on the first round and stays there.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.executor saw {"sinceSeconds":3600}; as u32: Ok(3600); the echoed data part still prints3600.0on the wire, which this PR leaves alone.Overlap with the A2A 1.1 stack
#385–#397 touch
pbconv.rsbut leaveproto_value_to_json_valueas it is; this diff applies cleanly onrefs/pull/396/head.🤖 Generated with Claude Code