fix(a2a): guard null DataPart metadata in ResponseConverter - #1400
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_958904859
branch
from
August 5, 2026 12:45
5c89e97 to
54639a6
Compare
`ResponseConverter.getLongRunningToolIds` dereferenced `DataPart.getMetadata()` without a null check, but the A2A spec treats `metadata` as optional and deserializes an absent or null field to `null`. Any peer returning such a `DataPart` in a task artifact or status message triggered an NPE that aborted the entire response conversion and failed the local agent's turn. Skip the part when metadata is missing, and cover all three call sites with regression tests. Malformed rather than absent peer metadata can still abort conversion through `parseMetadata`. That is a different trigger with a different fix, tracked separately in b/542523886. PiperOrigin-RevId: 959608801
copybara-service
Bot
force-pushed
the
test_958904859
branch
from
August 5, 2026 12:53
54639a6 to
fcfd9bd
Compare
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.
fix(a2a): guard null DataPart metadata in ResponseConverter
ResponseConverter.getLongRunningToolIdsdereferencedDataPart.getMetadata()without a null check, but the A2A spec treats
metadataas optional anddeserializes an absent or null field to
null. Any peer returning such aDataPartin a task artifact or status message triggered an NPE that abortedthe entire response conversion and failed the local agent's turn. Skip the part
when metadata is missing, and cover all three call sites with regression tests.
Malformed rather than absent peer metadata can still abort conversion through
parseMetadata. That is a different trigger with a different fix, trackedseparately in b/542523886.