Lock collision-safe checkpoint key behavior for thread IDs across checkpointers #1156

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

Originally created by @davidahmann on GitHub (Feb 20, 2026).

Problem

Checkpoint identity must remain collision-safe in multi-tenant usage; if key derivation ever regresses toward normalized-thread-only behavior, different tenant thread IDs could alias.

Why Now

Tenant density is increasing and checkpoint correctness is a platform contract. We need explicit regression coverage so this guarantee cannot silently regress.

Current Behavior Is Insufficient

Current implementations rely on composite keying (thread_id, namespace, checkpoint id), but this safety property is not clearly enforced by dedicated collision-focused tests across checkpointers.

Why Code Change

This needs code-level contract tests and any small hardening required in key-construction paths; docs are not sufficient.

Scope / Codepaths

  • libs/checkpoint/...
  • libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py
  • libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py

Acceptance / Validation

  • Add regression tests using collision-prone thread-id corpus (normalized-equivalent forms).
  • Demonstrate no key aliasing and backward-read compatibility.
  • Run checkpoint library format/lint/test gates.

Repro Evidence Packet

  • Version/commit under test: origin/main as of 2026-02-20.
  • Environment: macOS (Darwin), Python/uv per repo setup.
  • Minimal repro:
    1. Persist checkpoints for thread IDs that would collide under normalization-only schemes.
    2. Read each checkpoint back independently.
  • Expected: independent retrieval, no overwrite/alias.
  • Actual: contract is currently implicit; needs explicit non-regression coverage.
Originally created by @davidahmann on GitHub (Feb 20, 2026). ## Problem Checkpoint identity must remain collision-safe in multi-tenant usage; if key derivation ever regresses toward normalized-thread-only behavior, different tenant thread IDs could alias. ## Why Now Tenant density is increasing and checkpoint correctness is a platform contract. We need explicit regression coverage so this guarantee cannot silently regress. ## Current Behavior Is Insufficient Current implementations rely on composite keying (`thread_id`, namespace, checkpoint id), but this safety property is not clearly enforced by dedicated collision-focused tests across checkpointers. ## Why Code Change This needs code-level contract tests and any small hardening required in key-construction paths; docs are not sufficient. ## Scope / Codepaths - `libs/checkpoint/...` - `libs/checkpoint-postgres/langgraph/checkpoint/postgres/base.py` - `libs/checkpoint-sqlite/langgraph/checkpoint/sqlite/aio.py` ## Acceptance / Validation - Add regression tests using collision-prone thread-id corpus (normalized-equivalent forms). - Demonstrate no key aliasing and backward-read compatibility. - Run checkpoint library format/lint/test gates. ## Repro Evidence Packet - Version/commit under test: `origin/main` as of 2026-02-20. - Environment: macOS (Darwin), Python/uv per repo setup. - Minimal repro: 1. Persist checkpoints for thread IDs that would collide under normalization-only schemes. 2. Read each checkpoint back independently. - Expected: independent retrieval, no overwrite/alias. - Actual: contract is currently implicit; needs explicit non-regression coverage.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#1156