Skip to content

fix(a2a): require explicit adk_type metadata to convert A2A DataParts - #1398

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

fix(a2a): require explicit adk_type metadata to convert A2A DataParts#1398
copybara-service[bot] merged 1 commit into
mainfrom
test_958351176

Conversation

@copybara-service

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

Copy link
Copy Markdown

fix(a2a): require explicit adk_type metadata to convert A2A DataParts

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.

@copybara-service
copybara-service Bot force-pushed the test_958351176 branch 10 times, most recently from 1cc4d38 to 6dc4550 Compare August 5, 2026 12:43
`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
copybara-service Bot merged commit b704c5f into main Aug 5, 2026
@copybara-service
copybara-service Bot deleted the test_958351176 branch August 5, 2026 12:50
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