Problem
The JsonPlusRedisSerializer.dumps() method in langgraph/checkpoint/redis/jsonplus_redis.py has a bug that causes it to fail when serializing LangChain message objects (e.g., HumanMessage, AIMessage, SystemMessage).
Expected Behavior
Successfully returns bytes
b'{"lc":1,"type":"constructor","id":["langchain","schema","messages","HumanMessage"],"kwargs":{...}}'
And round-trip serialization should work:
deserialized = serializer.loads(serialized)
assert isinstance(deserialized, HumanMessage)
assert deserialized.content == "Hello, world!"
Error:
Root Cause
The current implementation attempts to call super().dumps() as a fallback when orjson.dumps(obj) fails.
However, the parent class JsonPlusSerializer does not have a dumps() method, causing an AttributeError. This means the fallback never works, and LangChain objects fail to serialize.