Skip to content

Conversation

@bsbodden
Copy link
Contributor

No description provided.

Fixes the serialization issue with langgraph.types.Send objects
reported in issue #94. Previously, Send objects were not being correctly
serialized and deserialized, which caused them to be returned as plain
dictionaries after a roundtrip. This led to `isinstance(packet, Send)`
checks failing in LangGraph's `prepare_single_task` function, resulting
in tasks not being added when handling interrupts.

Changes:
- Added Send object serialization in JsonPlusRedisSerializer._default_handler
  with a `__send__` type marker (similar to Interrupt handling)
- Added Send object preprocessing in _preprocess_interrupts method
- Added Send object deserialization in _revive_if_needed method
- Added Send object deserialization in base.py's _recursive_deserialize method
- Added comprehensive test suite (tests/test_send_serialization.py) with 6 tests
  covering various Send object scenarios

The fix ensures that Send objects maintain their type identity throughout
the serialization/deserialization cycle, allowing interrupt handling to
work correctly.

Resolves: #94
@bsbodden bsbodden merged commit 87791a1 into main Nov 20, 2025
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants