Skip to content

Send objects not serialized correctly #94

@thanusiak

Description

@thanusiak

While inspecting langgraph-checkpoint-redis 0.2.0 we noticed that the Send objects (langgraph.types.Send) are not saved correctly.

This is leading to issues with handling Interrupts - namely the user's response will not be treated as the response to the Interrupt.

This will happen inside of prepare_single_task in pregel._algo.py

if not isinstance(packet, Send):
                logger.warning(
                    f"Ignoring invalid packet type {type(packet)} in pending sends"
                )
                return.          <<<<< task not added

The way we overcame this is by adding a custom serializer in _default_handler:

if isinstance(obj, Send):
            return {
                "__send__": True,
                "arg": obj.arg,
                "node": obj.node,
            }

and loading it back in _recursive_deserialize.

@bsbodden
@abrookins

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions