feat(checkpoint-postgres): add task_path support and inline primitive merging#1967
Open
WilliamPeralta wants to merge 1 commit intolangchain-ai:mainfrom
Open
Conversation
… merging Port task_path support from the Python checkpoint-postgres implementation to bring JS to feature parity. This is a non-breaking change. Changes: - Add migrations 5-9 (thread_id indexes + task_path column on checkpoint_writes) - Add optional taskPath parameter to putWrites() and _dumpWrites() - Update SQL INSERT/UPSERT statements to include task_path column - Update pending sends/writes query ordering to sort by task_path, task_id, idx - Add read-side merging of inline primitive channel_values from checkpoint JSONB - Add integration tests for task_path and new migrations The Python implementation added task_path to support deterministic ordering of pending sends from nested subgraphs and parallel branches. Without it, the JS implementation may aggregate pending sends in non-deterministic order, causing state corruption during replay/forking. Backward compatibility: - task_path column has DEFAULT '' - all existing rows are valid - putWrites taskPath parameter is optional with default "" - Read-side primitive merging is additive (no-op for pure-JS checkpoints) - No changes to how data is written for existing callers Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
WilliamPeralta
added a commit
to WilliamPeralta/langgraphjs
that referenced
this pull request
Feb 17, 2026
… storage with Python BREAKING: Align checkpoint version format and channel_values storage with the Python implementation. Breaking changes: 1. Version format: getNextVersion now produces zero-padded string versions (e.g. "00000000000000000000000000000001.0482910384729105") instead of integer versions (1, 2, 3). Migration impact: Existing checkpoints with integer versions will still be readable. New checkpoints will use string versions. 2. Inline primitives: Primitive channel values (string, number, boolean, null) are now stored inline in the checkpoint JSONB column instead of in checkpoint_blobs. Requires PR langchain-ai#1967 (read-side merge) to be deployed first, so existing readers can handle both formats. These changes enable cross-compatibility between Python and JS checkpoint implementations sharing the same database, required for hybrid Python/JS LangGraph deployments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Open
5 tasks
WilliamPeralta
added a commit
to WilliamPeralta/langgraph-checkpoint-postgres
that referenced
this pull request
Feb 17, 2026
…s with Python parity fixes Fixes branching bug (#1812), adds task_path support, inline primitives, and globally unique version IDs. Upstream PRs: langchain-ai/langgraphjs#1967, langchain-ai/langgraphjs#1968
5 tasks
WilliamPeralta
added a commit
to WilliamPeralta/langgraphjs
that referenced
this pull request
Feb 24, 2026
… storage with Python BREAKING: Align checkpoint version format and channel_values storage with the Python implementation. Breaking changes: 1. Version format: getNextVersion now produces zero-padded string versions (e.g. "00000000000000000000000000000001.0482910384729105") instead of integer versions (1, 2, 3). Migration impact: Existing checkpoints with integer versions will still be readable. New checkpoints will use string versions. 2. Inline primitives: Primitive channel values (string, number, boolean, null) are now stored inline in the checkpoint JSONB column instead of in checkpoint_blobs. Requires PR langchain-ai#1967 (read-side merge) to be deployed first, so existing readers can handle both formats. These changes enable cross-compatibility between Python and JS checkpoint implementations sharing the same database, required for hybrid Python/JS LangGraph deployments. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
WilliamPeralta
added a commit
to WilliamPeralta/langgraphjs
that referenced
this pull request
Mar 2, 2026
… storage with Python BREAKING: Align checkpoint version format and channel_values storage with the Python implementation. Breaking changes: 1. Version format: getNextVersion now produces zero-padded string versions (e.g. "00000000000000000000000000000001.0482910384729105") instead of integer versions (1, 2, 3). Migration impact: Existing checkpoints with integer versions will still be readable. New checkpoints will use string versions. 2. Inline primitives: Primitive channel values (string, number, boolean, null) are now stored inline in the checkpoint JSONB column instead of in checkpoint_blobs. Requires PR langchain-ai#1967 (read-side merge) to be deployed first, so existing readers can handle both formats. These changes enable cross-compatibility between Python and JS checkpoint implementations sharing the same database, required for hybrid Python/JS LangGraph deployments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Port
task_pathsupport from the Python checkpoint-postgres implementation to bring JS to feature parity. This is a non-breaking change.Changes:
taskPathparameter toputWrites()and_dumpWrites()Why:
The Python implementation added
task_pathto support deterministic ordering of pending sends from nested subgraphs and parallel branches. Without it, the JS implementation may aggregate pending sends in non-deterministic order, causing state corruption during replay/forking.Backward compatibility:
DEFAULT ''— all existing rows are valid""Test plan
pnpm test:intinlibs/checkpoint-postgresputWritesworks with and withouttaskPathparametertask_pathcolumn exists and defaults to empty string