Skip to content

fix(checkpoint): don't silently return None when deserialization fails#6975

Open
Zephyr Cao (A404coder) wants to merge 1 commit intolangchain-ai:mainfrom
A404coder:fix/issue-6970
Open

fix(checkpoint): don't silently return None when deserialization fails#6975
Zephyr Cao (A404coder) wants to merge 1 commit intolangchain-ai:mainfrom
A404coder:fix/issue-6970

Conversation

@A404coder
Copy link

Summary

Fixes #6970 - JsonPlusSerializer was silently replacing values with None when msgpack deserialization failed.

Problem

When a module is in the allowed list but deserialization fails (e.g., module was deleted), the serializer silently returns None instead of raising an error. This causes silent data loss in checkpoints.

Solution

Remove the try/except blocks that swallowed exceptions in ext_hook. The allowed module check still returns the serialized data for disallowed modules, but allowed modules that fail deserialization now raise exceptions.

Changes

  • libs/checkpoint/langgraph/checkpoint/serde/jsonplus.py: Remove exception swallowing in EXT_CONSTRUCTOR_KW_ARGS, EXT_PYDANTIC_V1, EXT_PYDANTIC_V2 handling

Fixes #6970

Fixes langchain-ai#6970 - JsonPlusSerializer was silently replacing values with None
when msgpack deserialization failed for allowed modules.

Changes:
- Remove try/except blocks that swallowed exceptions in ext_hook
- Keep allowed module check but let deserialization errors propagate
- This prevents silent data loss when modules are deleted or changed

Now when a module is allowed but deserialization fails, an exception
is raised instead of returning None.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant