@@ -858,13 +858,18 @@ def __add__(self, other: "TextReasoningContent") -> "TextReasoningContent":
858858 else :
859859 annotations = self .annotations + other .annotations
860860
861+ # Replace protected data.
862+ # Discussion: https://github.com/microsoft/agent-framework/pull/2950#discussion_r2634345613
863+ protected_data = other .protected_data or self .protected_data
864+
861865 # Create new instance using from_dict for proper deserialization
862866 result_dict = {
863867 "text" : self .text + other .text ,
864868 "type" : "text_reasoning" ,
865869 "annotations" : [ann .to_dict (exclude_none = False ) for ann in annotations ] if annotations else None ,
866870 "additional_properties" : {** (self .additional_properties or {}), ** (other .additional_properties or {})},
867871 "raw_representation" : raw_representation ,
872+ "protected_data" : protected_data ,
868873 }
869874 return TextReasoningContent .from_dict (result_dict )
870875
@@ -900,6 +905,11 @@ def __iadd__(self, other: "TextReasoningContent") -> Self:
900905 self .raw_representation if isinstance (self .raw_representation , list ) else [self .raw_representation ]
901906 ) + (other .raw_representation if isinstance (other .raw_representation , list ) else [other .raw_representation ])
902907
908+ # Replace protected data.
909+ # Discussion: https://github.com/microsoft/agent-framework/pull/2950#discussion_r2634345613
910+ if other .protected_data is not None :
911+ self .protected_data = other .protected_data
912+
903913 # Merge annotations
904914 if other .annotations :
905915 if self .annotations is None :
0 commit comments