Skip to content

fix: cleanup blobs and writes for shallow classes #37

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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

noelpenne
Copy link

Follow-up to issue #13

This PR addresses an incomplete cleanup in ShallowRedisSaver and AsyncShallowRedisSaver related to leftover blobs and writes.

The initial fix (commit) did not fully remove all related keys. Specifically, the helper methods _make_shallow_redis_checkpoint_blob_key_pattern and _make_shallow_redis_checkpoint_writes_key_pattern did not apply the to_storage_safe_id and to_storage_safe_str utilities, which are used by the base class during blob dumping.

As a result, when checkpoint_ns was empty and channel_versions was populated, the cleanup logic failed to match and remove the correct keys — leading to orphaned blobs and write entries.

This PR ensures consistency in key generation across dumping and cleanup, allowing complete and reliable deletion of checkpoint-related data.

@noelpenne
Copy link
Author

noelpenne commented May 7, 2025

Just noticed a second issue: Since none of the values get encoded, if any of thread_id, checkpoint_ns, or channel contains the delimiter value : the parsing on read doesn't work properly and the shallow classes won't work properly.

This happens for langgraph where channels can for example be branch:to:agent. One solution would be to encode/decode in base64 to avoid delimiter conflicts.

For now, will set this PR to draft and open an issue with detailed problem description --> #39

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.

1 participant