Skip to content

Conversation

@bsbodden
Copy link
Contributor

RedisCluster doesn't have the connection_pool attribute that standard Redis clients have. This causes an AttributeError when using from_conn_string() context managers with Redis deployments that use proxy layers (like Azure Cache for Redis or Redis Enterprise).

Changes:

  • Add getattr check before accessing connection_pool.disconnect()
  • Applied to all checkpointer implementations (sync and async)
  • Added comprehensive tests for the fix

Fixes #93

RedisCluster doesn't have the connection_pool attribute that standard Redis
clients have. This causes an AttributeError when using from_conn_string()
context managers with Redis deployments that use proxy layers (like Azure
Cache for Redis or Redis Enterprise).

Changes:
- Add getattr check before accessing connection_pool.disconnect()
- Applied to all checkpointer implementations (sync and async)
- Added comprehensive tests for the fix

Fixes #93
@bsbodden bsbodden self-assigned this Aug 15, 2025
@bsbodden bsbodden merged commit 7a0e417 into main Aug 15, 2025
20 of 27 checks passed
@bsbodden bsbodden deleted the bsb/issue-93 branch August 15, 2025 22:30
bsbodden added a commit that referenced this pull request Nov 20, 2025
This commit 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

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
bsbodden added a commit that referenced this pull request Nov 20, 2025
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 added a commit that referenced this pull request Nov 20, 2025
* fix: Add Send object serialization support 

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

* release: bump version for 0.2.1 release
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.

AttributeError: 'RedisCluster' object has no attribute 'connection_pool'

2 participants