fix(langgraph): require langgraph-api>=0.10.0 for DeltaChannel#8043
fix(langgraph): require langgraph-api>=0.10.0 for DeltaChannel#8043Sydney Runkle (sydney-runkle) wants to merge 6 commits into
langgraph-api>=0.10.0 for DeltaChannel#8043Conversation
A graph using `DeltaChannel` reconstructs state via the saver's `get_delta_channel_history` API (added in `langgraph-checkpoint>=4.1.0`). Savers from older packages lack it and fail at runtime. `StateGraph.compile` now warns at compile time so users know to upgrade `langgraph-checkpoint`. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
|
I have a fix ready for this in PR #8044. Could you please assign this issue to me? |
Replace the checkpointer-capability heuristic with a direct `langgraph-api` version check: `DeltaChannel` reconstruction needs server-side support added in `langgraph-api>0.9.0`. `StateGraph.compile` now raises a `RuntimeError` when a delta-channel graph is compiled under an older API server, and is a no-op when `langgraph-api` is not installed (local execution). Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
DeltaChannel supportlanggraph-api version for DeltaChannel support
| return | ||
| if Version(api_version) > _MIN_DELTA_CHANNEL_API_VERSION: | ||
| return | ||
| raise RuntimeError( |
There was a problem hiding this comment.
I thought we can just fallback to non-delta channel, but raising error may be even better since they explictly want to get the benefits of delta channel.
There was a problem hiding this comment.
i think we want to raise bc delta channels have different types of reducers
| api_version = metadata.version("langgraph-api") | ||
| except metadata.PackageNotFoundError: | ||
| return | ||
| if Version(api_version) > _MIN_DELTA_CHANNEL_API_VERSION: |
There was a problem hiding this comment.
Would it include the 0.10.0rcs?
like 0.10.0rc3?
maybe even better to just check on >=0.10.0.
because all the RCs in 0.1.0 don't have prune support.
Use a `>=` bound (raise below 0.9.0) and simplify the check: drop the module-level constant and the early-return ladder. Verified end-to-end against real langgraph-api releases — 0.8.6 raises, 0.10.0 compiles. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
langgraph-api version for DeltaChannel supportlanggraph-api>=0.9.0 for DeltaChannel
|
Open SWE (@open-swe) can you please do this oh interesting. I was thinking of try import the version constant in langgraph-api, but I guess either way would work.also also let's just check on >=0.10.0, we don't want to include RCs for this particular condition |
Raise for API versions below 0.10.0 so prereleases such as 0.10.0rc1 are not accepted by the delta-channel compatibility check. Verified against real langgraph-api releases: 0.9.0 raises and 0.10.0 compiles. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
langgraph-api>=0.9.0 for DeltaChannellanggraph-api>=0.10.0 for DeltaChannel
Use the version constant exported by `langgraph-api` instead of package metadata for the DeltaChannel API compatibility check. This keeps the check aligned with the API package itself while still avoiding a hard dependency when `langgraph-api` is absent. Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
Revert the optional `langgraph_api.__version__` import path in favor of the
cleaner `importlib.metadata.version("langgraph-api")` check for DeltaChannel
API compatibility. This avoids importing the optional API package at compile
time while preserving the same version boundary.
Co-authored-by: open-swe[bot] <open-swe@users.noreply.github.com>
| CompiledStateGraph: The compiled `StateGraph`. | ||
| """ | ||
| checkpointer = ensure_valid_checkpointer(checkpointer) | ||
| _check_delta_channel_api_support(self.channels) |
There was a problem hiding this comment.
🟠 Frozen test env rejects DeltaChannel graphs
This compile-time check runs in the langgraph test environment, but CI installs dependencies with uv sync --frozen --group test --no-dev; on the 3.11-3.13 matrix the frozen libs/langgraph/uv.lock pulls langgraph-api==0.6.39 via langgraph-cli[inmem]. As a result, every existing test that compiles a DeltaChannel graph now fails before running. I reproduced the CI environment with Python 3.13 and g.compile() raises RuntimeError: DeltaChannel requires langgraph-api>=0.10.0, but 0.6.39 is installed. Please update the test/CI lock or dependency constraint to install langgraph-api>=0.10.0 alongside this check.
(Refers to line 1242)
Your feedback helps Open SWE learn. React with 👍 or 👎 to tell us if this review comment was useful.
Quanzheng Long (longquanzheng)
left a comment
There was a problem hiding this comment.
if you can, or someone else (including me), create a deployment to use this code with pinned lg-api to 0.9.0 to see if it fail.
| api_version = metadata.version("langgraph-api") | ||
| except metadata.PackageNotFoundError: | ||
| return | ||
| if Version(api_version) < Version("0.10.0"): |
There was a problem hiding this comment.
we are going to release 0.10.1 to fix the read+prune bug found by Parker.
maybe we can hold on with that(but not sure 0.10.1 will come tomorrow), or we can release this one, and then update this value to 0.10.1 in next release.
wdyt?
There was a problem hiding this comment.
yeah we can hold off on this one
|
How do we guarantee this for JS deployments? |
A graph that uses
DeltaChanneldepends on server-side reconstruction support added inlanggraph-api>=0.10.0. When such a graph is run under an older API server, delta channels fail at runtime.StateGraph.compilenow readsimportlib.metadata.version("langgraph-api")and raises aRuntimeErrorwith an upgrade hint when it is<0.10.0;packaging.version.Versionkeeps release candidates such as0.10.0rc1below the final0.10.0boundary. The check is a no-op whenlanggraph-apiis not installed (local execution) or when the graph has no delta channel.Verified end-to-end against real
langgraph-apireleases:0.9.0raises at compile time,0.10.0compiles successfully.Self-Hosted Release Note
StateGraph.compilenow raises a clear error when a graph usesDeltaChannelbut the installedlanggraph-apiis<0.10.0, prompting an upgrade instead of failing later at runtime.Test Plan
DeltaChannelgraph raises underlanggraph-api<0.10.0(including0.10.0rc1), succeeds at>=0.10.0, and is silent whenlanggraph-apiis absent or the graph has no delta channel.Made by Open SWE