[PR #6883] feat(checkpoint-postgres): add extended methods and conformance tests #5375

Open
opened 2026-02-20 17:51:37 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6883

State: open
Merged: No


Summary

  • Implements adelete_for_runs, acopy_thread, aprune on AsyncPostgresSaver (async)
  • Implements delete_for_runs, copy_thread, prune on both PostgresSaver (sync native) and AsyncPostgresSaver (sync wrapper)
  • Adds conformance test harness (tests/test_conformance.py) using langgraph-checkpoint-conformance
  • Adds langgraph-checkpoint-conformance as an editable dev dependency in pyproject.toml and uv.lock

Details

The extended methods complete the BaseCheckpointSaver interface for Postgres:

  • adelete_for_runs — deletes checkpoints, writes, and orphaned blobs by metadata.run_id
  • acopy_thread — copies all checkpoints, blobs, and writes from one thread to another (idempotent via ON CONFLICT DO NOTHING)
  • aprune — supports "keep_latest" (uses DISTINCT ON) and "delete" strategies with proper blob cleanup

Test plan

  • cd libs/checkpoint-postgres && make lint passes
  • cd libs/checkpoint-postgres && make test passes (includes conformance tests)
  • CI runs conformance tests via existing make test in the postgres matrix job

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6883 **State:** open **Merged:** No --- ## Summary - Implements `adelete_for_runs`, `acopy_thread`, `aprune` on `AsyncPostgresSaver` (async) - Implements `delete_for_runs`, `copy_thread`, `prune` on both `PostgresSaver` (sync native) and `AsyncPostgresSaver` (sync wrapper) - Adds conformance test harness (`tests/test_conformance.py`) using `langgraph-checkpoint-conformance` - Adds `langgraph-checkpoint-conformance` as an editable dev dependency in `pyproject.toml` and `uv.lock` ## Details The extended methods complete the `BaseCheckpointSaver` interface for Postgres: - **`adelete_for_runs`** — deletes checkpoints, writes, and orphaned blobs by `metadata.run_id` - **`acopy_thread`** — copies all checkpoints, blobs, and writes from one thread to another (idempotent via `ON CONFLICT DO NOTHING`) - **`aprune`** — supports `"keep_latest"` (uses `DISTINCT ON`) and `"delete"` strategies with proper blob cleanup ## Test plan - [ ] `cd libs/checkpoint-postgres && make lint` passes - [ ] `cd libs/checkpoint-postgres && make test` passes (includes conformance tests) - [ ] CI runs conformance tests via existing `make test` in the postgres matrix job 🤖 Generated with [Claude Code](https://claude.com/claude-code)
yindo added the pull-request label 2026-02-20 17:51:37 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#5375