fix: make Redis checkpoint listing conformant#186
fix: make Redis checkpoint listing conformant#186CreativeSystemsDevelopment wants to merge 2 commits intoredis-developer:mainfrom
Conversation
There was a problem hiding this comment.
💡 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".
| if key == "thread_id": | ||
| continue |
There was a problem hiding this comment.
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 👍 / 👎.
| "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, |
There was a problem hiding this comment.
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 👍 / 👎.
Summary
beforepagination consistently for checkpoint IDs that are not ULIDsprune([])a no-op for async/sync Redis saversValidation
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.pylanggraph-checkpoint-conformance==0.0.2against native Redis 8.6.2: FULL, all detected capabilities passedDocker/Testcontainers pytest was not run locally because Docker is not installed in this WSL distro; the repo CI should exercise the containerized fixture.