fix(a2a): drop unparseable A2A metadata instead of aborting conversion - #1401
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_958968673
branch
from
August 6, 2026 11:01
3203540 to
7866eb2
Compare
`ResponseConverter.parseMetadata` rethrew every deserialization failure as `IllegalArgumentException`, which propagated out of `taskToEvent`, `messageToEvent` and `handleTaskUpdate`. Because `adk_grounding_metadata`, `adk_usage_metadata`, `adk_custom_metadata` and `adk_error_code` are all peer-controlled, a single unparseable value from a remote agent could break the caller's turn. Log at WARN and drop the offending field instead, so auxiliary telemetry cannot take down the whole conversion. On the Java side these keys are read-only: nothing in ADK Java writes them, so a parse failure is always peer data, never our own serialization. This matches the drop semantics in ADK Kotlin (`LegacyA2aConverters.kt` logs WARN and returns null) and ADK Python (`to_adk_event._extract_genai_metadata` logs and returns None); Java was the outlier. The warning here omits the parser message, which quotes the peer's bytes, so it follows Python rather than Kotlin, which still attaches the exception. PiperOrigin-RevId: 960211499
copybara-service
Bot
force-pushed
the
test_958968673
branch
from
August 6, 2026 11:08
7866eb2 to
b75c916
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): drop unparseable A2A metadata instead of aborting conversion
ResponseConverter.parseMetadatarethrew every deserialization failure asIllegalArgumentException, which propagated out oftaskToEvent,messageToEventandhandleTaskUpdate. Becauseadk_grounding_metadata,adk_usage_metadata,adk_custom_metadataandadk_error_codeare allpeer-controlled, a single unparseable value from a remote agent could break the
caller's turn. Log at WARN and drop the offending field instead, so auxiliary
telemetry cannot take down the whole conversion.
On the Java side these keys are read-only: nothing in ADK Java writes them, so a
parse failure is always peer data, never our own serialization. This matches the
drop semantics in ADK Kotlin (
LegacyA2aConverters.ktlogs WARN and returnsnull) and ADK Python (
to_adk_event._extract_genai_metadatalogs and returnsNone); Java was the outlier. The warning here omits the parser message, which
quotes the peer's bytes, so it follows Python rather than Kotlin, which still
attaches the exception.