Skip to content

fix: make Redis checkpoint listing conformant#186

Open
CreativeSystemsDevelopment wants to merge 2 commits intoredis-developer:mainfrom
CreativeSystemsDevelopment:codex/checkpoint-list-conformance
Open

fix: make Redis checkpoint listing conformant#186
CreativeSystemsDevelopment wants to merge 2 commits intoredis-developer:mainfrom
CreativeSystemsDevelopment:codex/checkpoint-list-conformance

Conversation

@CreativeSystemsDevelopment
Copy link
Copy Markdown

Summary

  • filter empty checkpoint namespaces explicitly instead of treating them as absent
  • allow custom metadata filters by post-filtering stored checkpoint metadata
  • apply before pagination consistently for checkpoint IDs that are not ULIDs
  • make prune([]) a no-op for async/sync Redis savers
  • add sync and async regression coverage for namespace, custom metadata, and before pagination

Validation

  • PYTHONPATH=/tmp/langgraph-redis-upstream agent_server/.venv/bin/python -m py_compile langgraph/checkpoint/redis/base.py langgraph/checkpoint/redis/__init__.py langgraph/checkpoint/redis/aio.py tests/test_checkpoint_filters.py
  • LangGraph langgraph-checkpoint-conformance==0.0.2 against native Redis 8.6.2: FULL, all detected capabilities passed
  • Direct sync/async regression script against native Redis 8.6.2: root namespace, custom metadata, and before pagination passed

Docker/Testcontainers pytest was not run locally because Docker is not installed in this WSL distro; the repo CI should exercise the containerized fixture.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5494d2e7a1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread langgraph/checkpoint/redis/base.py Outdated
Comment on lines +46 to +47
if key == "thread_id":
continue
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Skip run_id in metadata post-filter checks

When list/alist falls back to post-filtering (for example filter={"run_id": "r1", "score": 42}), _metadata_filter_matches re-validates filter keys against metadata but only skips thread_id. run_id is indexed separately and is often absent from metadata when it comes from config, so valid results are dropped after the Redis query already matched run_id. This makes mixed indexed+custom filters return empty/incomplete results in both sync and async listing paths.

Useful? React with 👍 / 👎.

Comment thread langgraph/checkpoint/redis/__init__.py Outdated
"has_writes", # Include has_writes to optimize pending_writes loading
],
num_results=limit or 10000,
num_results=10000 if requires_post_filter else limit or 10000,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Respect caller limit in post-filter query window

In post-filter mode the search always fetches only the first 10,000 docs, then applies metadata/before filtering in Python. If matching checkpoints are beyond that initial window (or the caller requests limit > 10000), they can never be returned even though they exist, so results become silently incomplete. This affects pagination/filter correctness whenever histories are larger than 10k entries.

Useful? React with 👍 / 👎.

@bsbodden bsbodden assigned bsbodden and limjoobin and unassigned bsbodden Apr 26, 2026
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.

3 participants