Skip to content

fix: AsyncRedisSaver aget_tuple returning None for checkpoint_id #65

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

abrookins
Copy link
Contributor

Fixes issue where AsyncRedisSaver.aget_tuple() returned None for checkpoint_id when no checkpoint_id was specified in the config, while RedisSaver.get_tuple() correctly returned the retrieved checkpoint ID.

The bug was caused by using the original checkpoint_id parameter (which may be None) instead of doc_checkpoint_id (the actual ID retrieved from Redis document).

Fixed two locations in aget_tuple method:

  • Config construction: Use doc_checkpoint_id instead of checkpoint_id
  • _aload_pending_writes call: Use doc_checkpoint_id to match sync behavior

Added comprehensive test coverage to verify the fix and prevent regression.

Resolves #64

Generated with Claude Code

Fixes issue where AsyncRedisSaver.aget_tuple() returned None for checkpoint_id
when no checkpoint_id was specified in the config, while RedisSaver.get_tuple()
correctly returned the retrieved checkpoint ID.

The bug was caused by using the original checkpoint_id parameter (which may be None)
instead of doc_checkpoint_id (the actual ID retrieved from Redis document).

Fixed two locations in aget_tuple method:
- Config construction: Use doc_checkpoint_id instead of checkpoint_id
- _aload_pending_writes call: Use doc_checkpoint_id to match sync behavior

Added comprehensive test coverage to verify the fix and prevent regression.

Resolves #64

Co-authored-by: Tyler Hutcherson <tylerhutcherson@users.noreply.github.com>
@abrookins
Copy link
Contributor Author

This appears to be the correct fix. You can see that the sync version works the same way here: https://github.com/redis-developer/langgraph-redis/blame/0899d7415fa81640f642539c043bc93285415dc2/langgraph/checkpoint/redis/__init__.py#L462

@codemug
Copy link

codemug commented Jun 24, 2025

Have been facing the issue of repeated interrupts because of this. Verified on my local machine, the checkpointer works correctly after applying this fix. Please merge and release this, can't use the AsyncRedisSaver in my agents without this.

@tylerhutcherson tylerhutcherson self-requested a review June 24, 2025 12:45
@tylerhutcherson tylerhutcherson merged commit c425317 into main Jun 24, 2025
19 checks passed
@tylerhutcherson tylerhutcherson deleted the claude/issue-64-20250623_221640 branch June 24, 2025 12:46
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.

AsyncRedisSaver aget_tuple Incorrect Checkpoint ID
3 participants