Skip to content

fix(a2a): guard null DataPart metadata in ResponseConverter - #1400

Merged
copybara-service[bot] merged 1 commit into
mainfrom
test_958904859
Aug 5, 2026
Merged

fix(a2a): guard null DataPart metadata in ResponseConverter#1400
copybara-service[bot] merged 1 commit into
mainfrom
test_958904859

Conversation

@copybara-service

@copybara-service copybara-service Bot commented Aug 4, 2026

Copy link
Copy Markdown

fix(a2a): guard null DataPart metadata in ResponseConverter

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.

`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
copybara-service Bot merged commit fcfd9bd into main Aug 5, 2026
@copybara-service
copybara-service Bot deleted the test_958904859 branch August 5, 2026 12:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant