fix(a2a): require explicit adk_type metadata to convert A2A DataParts - #1398
Merged
Conversation
copybara-service
Bot
force-pushed
the
test_958351176
branch
10 times, most recently
from
August 5, 2026 12:43
1cc4d38 to
6dc4550
Compare
`PartConverter` inferred the GenAI part type from the shape of an inbound `DataPart` payload: any map holding `name` + `args` became a `FunctionCall`, `name` + `response` a `FunctionResponse`, and likewise for executable code and code execution results. Conversion now requires the sender to label the part with the `adk_type` metadata key; unlabelled payloads are carried through as generic inline JSON. That stops a generic peer payload which merely happens to carry those keys from being silently reinterpreted as a control part, and matches the Python, Kotlin and Go converters, which have always keyed off the metadata alone. ADK-to-ADK traffic is unaffected, since the outbound helpers always set `adk_type`. Explicitly labelled parts are still converted - that path is required for relaying human-in-the-loop and long-running tool calls between agents - so this change alone does not prevent a peer from emitting a function call. The execution path behind it is closed by a follow-up change. PiperOrigin-RevId: 959607436
copybara-service
Bot
force-pushed
the
test_958351176
branch
from
August 5, 2026 12:50
6dc4550 to
b704c5f
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): require explicit adk_type metadata to convert A2A DataParts
PartConverterinferred the GenAI part type from the shape of an inboundDataPartpayload: any map holdingname+argsbecame aFunctionCall,name+responseaFunctionResponse, and likewise for executable code andcode execution results. Conversion now requires the sender to label the part
with the
adk_typemetadata key; unlabelled payloads are carried through asgeneric inline JSON.
That stops a generic peer payload which merely happens to carry those keys from
being silently reinterpreted as a control part, and matches the Python, Kotlin
and Go converters, which have always keyed off the metadata alone. ADK-to-ADK
traffic is unaffected, since the outbound helpers always set
adk_type.Explicitly labelled parts are still converted - that path is required for
relaying human-in-the-loop and long-running tool calls between agents - so this
change alone does not prevent a peer from emitting a function call. The
execution path behind it is closed by a follow-up change.