[PR #6448] fix(checkpoint): InMemorySaver context managers should return self instance #5042

Closed
opened 2026-02-20 17:51:08 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6448

State: closed
Merged: Yes


Hello, I believe that the __enter__ and __aenter__ functions of the InMemorySaver class should return self instances. I tried wrapping checkpointers in a custom function in our library that returns AbstractAsyncContextManagers and found out that actually this does not work as IMO intended for the InMemorySaver.

In this PR I am proposing a fix and adding two simple test cases.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6448 **State:** closed **Merged:** Yes --- Hello, I believe that the `__enter__` and `__aenter__` functions of the `InMemorySaver` class should return `self` instances. I tried wrapping checkpointers in a custom function in our library that returns `AbstractAsyncContextManager`s and found out that actually this does not work as IMO intended for the `InMemorySaver`. In this PR I am proposing a fix and adding two simple test cases.
yindo added the pull-request label 2026-02-20 17:51:08 -05:00
yindo closed this issue 2026-02-20 17:51:08 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5042