mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-20 22:52:29 +02:00
Issue Support for `Checkpoint.metadata.writes` was dropped in `langgraph` v0.5.x. In `langgraph-checkpoint-postgres` v2.0.23, metadata was serialized with `BasePostgresSaver._dump_metadata` -> `JsonPlusSerializer.dumps` which handles `pydantic.BaseModel`. In v2.0.23, metadata is serialized with `psycopg.types.json.Jsonb`, which raises `TypeError: Object of type AIMessage is not JSON serializable` when trying to serialize `writes`. Solution - Add `BaseCheckpointSaver.get_serializable_checkpoint_metadata` which pops the `writes` key. - Log deprecation warning when strange version combinations are used Solves https://github.com/langchain-ai/langgraph/issues/5769 --------- Co-authored-by: Alex Kondratev <56111142+soapun@users.noreply.github.com>