-
Notifications
You must be signed in to change notification settings - Fork 13
Closed
Description
Example code:
from langgraph.checkpoint.redis import AsyncRedisSaver
import asyncio
async def main():
saver = AsyncRedisSaver(redis_url="redis://localhost:6379")
await saver.setup() # <- causes RuntimeWarning
asyncio.run(main())
Error Message and Stack Trace (if applicable)
RuntimeWarning: coroutine 'AsyncSearchIndex.create' was never awaited
self.checkpoints_index.create(overwrite=False)
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
...
Description
AsyncRedisSaver.setup() internally calls AsyncSearchIndex.create() (which is async) without using await, leading to RuntimeWarning: coroutine was never awaited and runtime issues.
Expected Behaviour:
The setup() method should either:
- Be defined as async def setup(...), so the caller knows to await it, or
- Internally await the coroutines like .create(...), or
- Clearly document that the user is responsible for calling await saver.checkpoints_index.create(...) directly (which isn't ideal).
Suggested Fix:
Update AsyncRedisSaver.setup() to:
async def setup(self):
await self.checkpoints_index.create(overwrite=False)
await self.checkpoint_blobs_index.create(overwrite=False)
await self.checkpoint_writes_index.create(overwrite=False)
Temporary Workaround:
Use RedisSaver instead of AsyncRedisSaver until the issue is fixed.
System Info:
- langgraph-checkpoint-redis: 0.0.8
- redis: 6.2.0
- Python: 3.12
- OS: macOS Sequoia 15.5
Metadata
Metadata
Assignees
Labels
No labels