fix: restore A2A inbound metadata and handle metadata-only events#5205
Open
enjoykumawat wants to merge 1 commit intogoogle:mainfrom
Open
fix: restore A2A inbound metadata and handle metadata-only events#5205enjoykumawat wants to merge 1 commit intogoogle:mainfrom
enjoykumawat wants to merge 1 commit intogoogle:mainfrom
Conversation
The inbound converters in to_adk_event.py only restored `actions` from A2A metadata, silently dropping `custom_metadata`, `usage_metadata`, `error_code`, and `grounding_metadata`. Additionally, `_create_event()` returned None for metadata-only messages with no parts or actions. Add `_extract_event_metadata()` to restore these fields from A2A metadata and update `_create_event()` to accept and apply them. Metadata-only messages now correctly produce a valid Event.
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.
Summary
custom_metadataand other event metadata fields from A2A inbound messages that were silently dropped during conversion_create_event()to return a validEventwhen metadata is present but there are no content parts or actionsRoot Cause
convert_a2a_message_to_event()only restoredactionsfrom A2A metadata. All other ADK event metadata fields were silently dropped._create_event()returnedNonefor metadata-only messages.Test Plan
custom_metadatarestoration from A2A metadataFixes #5185