Bug Description
_serialize_value() in from_adk_event.py falls through to str() for JSON-native Python types (dict, list, bool, int, float), corrupting structured metadata values into their string representations during A2A event conversion.
Steps to Reproduce
from google.adk.a2a.converters.from_adk_event import _serialize_value
metadata = {"retry": True, "max_attempts": 3, "tags": ["alpha", "beta"]}
result = _serialize_value(metadata)
print(type(result), result)
# Actual: <class 'str'> "{'retry': True, 'max_attempts': 3, 'tags': ['alpha', 'beta']}"
# Expected: <class 'dict'> {'retry': True, 'max_attempts': 3, 'tags': ['alpha', 'beta']}
Expected Behavior
JSON-native types (dict, list, str, bool, int, float) should be preserved as-is since they are already valid JSON values, not converted to strings.
Actual Behavior
All non-Pydantic values that aren't None are passed through str(), which corrupts structured data into Python repr strings.
Bug Description
_serialize_value()infrom_adk_event.pyfalls through tostr()for JSON-native Python types (dict,list,bool,int,float), corrupting structured metadata values into their string representations during A2A event conversion.Steps to Reproduce
Expected Behavior
JSON-native types (
dict,list,str,bool,int,float) should be preserved as-is since they are already valid JSON values, not converted to strings.Actual Behavior
All non-Pydantic values that aren't
Noneare passed throughstr(), which corrupts structured data into Python repr strings.