Description
When serializing workflow state to a checkpoint, we use two reserved keywords (__af_dataclass__ and __af_model__) to achieve polymorphic serialization.
However, we don't check for if these reserved keywords are present in objects that neither dataclasses nor Pydantic models. This leads to potential issue during deserialization where we'd mistakenly deserialize a Json into an incorrect type.
Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework-core
Python Version
No response
Additional Context
No response