Skip to content

Python: [Bug]: Workflow checkpoint serialization and deserialization reserved keywords allow overwrite #3225

@TaoChenOSU

Description

@TaoChenOSU

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingpython

Type

Projects

Status

Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions