From 457edaa75bb4f38c1ef2e455d601fcfa213bc840 Mon Sep 17 00:00:00 2001 From: Sydney Runkle Date: Mon, 21 Jul 2025 12:32:23 -0400 Subject: [PATCH 1/5] locks --- libs/langgraph/uv.lock | 2 +- libs/prebuilt/uv.lock | 2 +- libs/sdk-py/pyproject.toml | 2 +- libs/sdk-py/uv.lock | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libs/langgraph/uv.lock b/libs/langgraph/uv.lock index 1c8f4d0bb..f4c16ecd3 100644 --- a/libs/langgraph/uv.lock +++ b/libs/langgraph/uv.lock @@ -1463,7 +1463,7 @@ wheels = [ [[package]] name = "langgraph-sdk" -version = "0.1.73" +version = "0.1.74" source = { editable = "../sdk-py" } dependencies = [ { name = "httpx" }, diff --git a/libs/prebuilt/uv.lock b/libs/prebuilt/uv.lock index 56db79769..7e4ac06bd 100644 --- a/libs/prebuilt/uv.lock +++ b/libs/prebuilt/uv.lock @@ -507,7 +507,7 @@ dev = [ [[package]] name = "langgraph-sdk" -version = "0.1.73" +version = "0.1.74" source = { editable = "../sdk-py" } dependencies = [ { name = "httpx" }, diff --git a/libs/sdk-py/pyproject.toml b/libs/sdk-py/pyproject.toml index 7a33a33d8..68ef541a1 100644 --- a/libs/sdk-py/pyproject.toml +++ b/libs/sdk-py/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "langgraph-sdk" -version = "0.1.73" +version = "0.1.74" description = "SDK for interacting with LangGraph API" authors = [] requires-python = ">=3.9" diff --git a/libs/sdk-py/uv.lock b/libs/sdk-py/uv.lock index ad6e10698..246dc37ba 100644 --- a/libs/sdk-py/uv.lock +++ b/libs/sdk-py/uv.lock @@ -119,7 +119,7 @@ wheels = [ [[package]] name = "langgraph-sdk" -version = "0.1.73" +version = "0.1.74" source = { editable = "." } dependencies = [ { name = "httpx" }, From 819eae891ef121a073728f35a309f1f0e85b7008 Mon Sep 17 00:00:00 2001 From: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com> Date: Mon, 21 Jul 2025 12:33:00 -0400 Subject: [PATCH 2/5] feat(sdk-py): add interrupts to `ThreadState` (#5603) --- libs/sdk-py/langgraph_sdk/schema.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libs/sdk-py/langgraph_sdk/schema.py b/libs/sdk-py/langgraph_sdk/schema.py index 9ad1c5b8b..1f125e0df 100644 --- a/libs/sdk-py/langgraph_sdk/schema.py +++ b/libs/sdk-py/langgraph_sdk/schema.py @@ -251,7 +251,7 @@ class Thread(TypedDict): values: Json """The current state of the thread.""" interrupts: dict[str, list[Interrupt]] - """Interrupts which were thrown in this thread""" + """Mapping of task ids to interrupts that were raised in that task.""" class ThreadTask(TypedDict): @@ -284,6 +284,8 @@ class ThreadState(TypedDict): """The ID of the parent checkpoint. If missing, this is the root checkpoint.""" tasks: Sequence[ThreadTask] """Tasks to execute in this step. If already attempted, may contain an error.""" + interrupts: list[Interrupt] + """Interrupts which were thrown in this thread.""" class ThreadUpdateStateResponse(TypedDict): From 2153d367267b3027451e19d797807261fc093d5a Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Mon, 21 Jul 2025 18:48:40 +0100 Subject: [PATCH 3/5] feat(langgraph): Handle ParentCommand in RemoteGraph (#5600) - when receiving a "command" stream event raise ParentCommand exception for caller graph to handle --- libs/langgraph/langgraph/pregel/remote.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/langgraph/langgraph/pregel/remote.py b/libs/langgraph/langgraph/pregel/remote.py index 38b334e46..30b6eed8d 100644 --- a/libs/langgraph/langgraph/pregel/remote.py +++ b/libs/langgraph/langgraph/pregel/remote.py @@ -40,7 +40,7 @@ from langgraph.constants import ( INTERRUPT, NS_SEP, ) -from langgraph.errors import GraphInterrupt +from langgraph.errors import GraphInterrupt, ParentCommand from langgraph.pregel.protocol import PregelProtocol from langgraph.pregel.types import All, PregelTask, StateSnapshot, StreamMode from langgraph.types import Command, Interrupt, StreamProtocol @@ -672,6 +672,9 @@ class RemoteGraph(PregelProtocol): ns = tuple(ns_.split(NS_SEP)) else: mode, ns = chunk.event, () + # raise ParentCommand exception for command events + if mode == "command" and chunk.data.get("graph") == Command.PARENT: + raise ParentCommand(Command(**chunk.data)) # prepend caller ns (as it is not passed to remote graph) if caller_ns := (config or {}).get(CONF, {}).get(CONFIG_KEY_CHECKPOINT_NS): caller_ns = tuple(caller_ns.split(NS_SEP)) @@ -771,6 +774,9 @@ class RemoteGraph(PregelProtocol): ns = tuple(ns_.split(NS_SEP)) else: mode, ns = chunk.event, () + # raise ParentCommand exception for command events + if mode == "command" and chunk.data.get("graph") == Command.PARENT: + raise ParentCommand(Command(**chunk.data)) # prepend caller ns (as it is not passed to remote graph) if caller_ns := (config or {}).get(CONF, {}).get(CONFIG_KEY_CHECKPOINT_NS): caller_ns = tuple(caller_ns.split(NS_SEP)) From 1ee6bfeb8db82aaaac365f802c973ef852efc123 Mon Sep 17 00:00:00 2001 From: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:17:00 -0400 Subject: [PATCH 4/5] release(langgraph): v0.5.4 (#5605) --- libs/langgraph/pyproject.toml | 2 +- libs/langgraph/uv.lock | 2 +- libs/prebuilt/uv.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/langgraph/pyproject.toml b/libs/langgraph/pyproject.toml index f14392880..2a4b96228 100644 --- a/libs/langgraph/pyproject.toml +++ b/libs/langgraph/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "langgraph" -version = "0.5.3" +version = "0.5.4" description = "Building stateful, multi-actor applications with LLMs" authors = [] requires-python = ">=3.9" diff --git a/libs/langgraph/uv.lock b/libs/langgraph/uv.lock index f4c16ecd3..23d8febfd 100644 --- a/libs/langgraph/uv.lock +++ b/libs/langgraph/uv.lock @@ -1192,7 +1192,7 @@ wheels = [ [[package]] name = "langgraph" -version = "0.5.3" +version = "0.5.4" source = { editable = "." } dependencies = [ { name = "langchain-core" }, diff --git a/libs/prebuilt/uv.lock b/libs/prebuilt/uv.lock index 7e4ac06bd..1f3f105d2 100644 --- a/libs/prebuilt/uv.lock +++ b/libs/prebuilt/uv.lock @@ -316,7 +316,7 @@ wheels = [ [[package]] name = "langgraph" -version = "0.5.3" +version = "0.5.4" source = { editable = "../langgraph" } dependencies = [ { name = "langchain-core" }, From be088801baa2a5271e035db91d64dc72a727fbc7 Mon Sep 17 00:00:00 2001 From: Sydney Runkle <54324534+sydney-runkle@users.noreply.github.com> Date: Mon, 21 Jul 2025 14:25:37 -0400 Subject: [PATCH 5/5] fix(langgraph): fix assertion in test (#5606) --- libs/langgraph/tests/test_large_cases.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/langgraph/tests/test_large_cases.py b/libs/langgraph/tests/test_large_cases.py index 7ff1343db..62cf5ffa1 100644 --- a/libs/langgraph/tests/test_large_cases.py +++ b/libs/langgraph/tests/test_large_cases.py @@ -6981,4 +6981,4 @@ def test_subgraph_to_end_does_not_warn() -> None: graph = builder.compile() response = graph.invoke({"x": "hello"}) - print(response) + assert response == {"x": "hello!"}