Skip to content

Conversation

bsbodden
Copy link
Contributor

Add support for removing TTL from Redis checkpoints to make them persistent. This enables "pinning" specific threads that should never expire while allowing others to be
cleaned up automatically.

Changes:

  • Add support for ttl_minutes=-1 parameter to trigger Redis PERSIST command
  • Implement TTL removal in both sync and async checkpoint savers
  • Apply PERSIST to main key and all related keys (blobs, writes)
  • Add comprehensive test coverage for TTL removal functionality
  • Update README with documentation for the pinning feature

@bsbodden bsbodden requested a review from Copilot August 15, 2025 18:05
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for removing TTL from Redis checkpoints to enable "pinning" specific threads that should never expire while allowing others to be cleaned up automatically.

  • Implements TTL removal using ttl_minutes=-1 parameter to trigger Redis PERSIST command
  • Adds comprehensive test coverage for the TTL removal functionality
  • Updates documentation with examples of the pinning feature

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
tests/test_ttl_removal.py Comprehensive test suite covering TTL removal scenarios including sync/async operations and related keys
langgraph/checkpoint/redis/base.py Implements TTL removal logic in sync checkpoint saver using Redis PERSIST command
langgraph/checkpoint/redis/aio.py Implements TTL removal logic in async checkpoint saver and includes minor formatting fix
README.md Documents the TTL removal feature with usage examples and updated feature description

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

  Add support for removing TTL from Redis checkpoints to make them persistent. This enables "pinning" specific threads that should never expire while allowing others to be
  cleaned up automatically.

  Changes:
  - Add support for `ttl_minutes=-1` parameter to trigger Redis PERSIST command
  - Implement TTL removal in both sync and async checkpoint savers
  - Apply PERSIST to main key and all related keys (blobs, writes)
  - Add comprehensive test coverage for TTL removal functionality
  - Update README with documentation for the pinning feature
@bsbodden bsbodden merged commit b186a39 into main Aug 15, 2025
19 checks passed
@bsbodden bsbodden deleted the bsb/order-66 branch August 15, 2025 18: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.

1 participant