You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Python: [Bug]: SerializationMixin does not recursively serialize nested containers #7788
SerializationMixin.to_dict() serializes framework objects when they are direct list items or dictionary values, but it stops after one container level. A SerializationProtocol object nested inside a combination such as dict -> list -> dict remains in the returned mapping. As a result, SerializationMixin.to_json() raises TypeError for otherwise supported nested state.
Expected: supported objects are recursively converted at any list/dictionary depth, while unsupported values keep the existing behavior of being skipped.
Actual: nested supported objects are returned unchanged and cannot be JSON encoded.
🤖 Automated triage reproduction notes(agent-authored — trust but verify)
Agent analysis
Repro: python/packages/core/agent_framework/_serialization.py::SerializationMixin.to_dict at lines 345-389 stops traversing when a list or dictionary contains another container, and to_json fails at line 416. Trigger it with a SerializationMixin attribute shaped as dict -> list -> dict -> list -> SerializationMixin; the focused test constructs that shape and observes TypeError: Object of type Item is not JSON serializable.
Activity
github-actions commentedon Aug 21, 2026
🤖 Automated triage reproduction notes (agent-authored — trust but verify)
Agent analysis
Repro:
python/packages/core/agent_framework/_serialization.py::SerializationMixin.to_dictat lines 345-389 stops traversing when a list or dictionary contains another container, andto_jsonfails at line 416. Trigger it with aSerializationMixinattribute shaped asdict -> list -> dict -> list -> SerializationMixin; the focused test constructs that shape and observesTypeError: Object of type Item is not JSON serializable.python/packages/core/tests/core/test_serializable_mixin.py::TestSerializationMixin::test_to_json_with_serialization_protocol_in_nested_containers1.14.01.14.0