mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-19 22:25:44 +02:00
Instead of a recursive SQL CTE, collect the ancestor checkpoint ID chain in Python by fetching all (checkpoint_id, parent_checkpoint_id) for the thread in one query, then fetch writes with a plain WHERE checkpoint_id = ANY(...). Simpler, avoids recursive query planner overhead, and uses well-indexed lookups.