Repository navigation
fix(a2a-pb): decode integral Value numbers as integers - #440
Merged
muscariello merged 1 commit intoNov 2, 2026
Merged
muscariello merged 1 commit into
muscariello merged 1 commit into
Conversation
muscariello
force-pushed
the
stack/02-pb-integral-numbers
branch
from
November 1, 2026 21:28
9e749f4 to
3e5e2eb
Compare
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: #399
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: gulldan <[email protected]>
muscariello
force-pushed
the
stack/02-pb-integral-numbers
branch
from
November 2, 2026 12:02
3e5e2eb to
8068070
Compare
msardara
approved these changes
Nov 2, 2026
Merged
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 #399. Replaces #405. Stacked on #439: review only the last commit.
Cause:
google.protobuf.Valuestores every number as a double, andproto_value_to_json_valueturned each one back into a JSON float. An integer in adatapart or inmetadatatherefore reached the executor as3600.0, andserde_json::from_value::<u32>rejected it. Every binding decodes through this function.Fix: a whole number within ±2^53, where a double is exact, is returned as an integer (
json_numberinpbconv.rs). Fractions, larger magnitudes and non-finite values behave as before, and the protojson wire form is unchanged.Tests: new
integers_in_data_parts_stay_integers; the two round-trip tests no longer avoid integers.Unproven: the failure on
mainand the fuzz-idempotence claim in #405 were not run locally. CI is the check.