This commit is contained in:
Nuno Campos
2024-09-21 17:52:17 -07:00
parent 89bb7fe178
commit 2fccd09585
3 changed files with 10 additions and 6 deletions
+3
View File
@@ -30,6 +30,7 @@ from langgraph.checkpoint.base import (
from langgraph.constants import (
CONFIG_KEY_CHECKPOINT_MAP,
CONFIG_KEY_CHECKPOINTER,
CONFIG_KEY_GRAPH_COUNT,
CONFIG_KEY_READ,
CONFIG_KEY_SEND,
CONFIG_KEY_TASK_ID,
@@ -429,6 +430,7 @@ def prepare_single_task(
manager.get_child(f"graph:step:{step}") if manager else None
),
configurable={
CONFIG_KEY_GRAPH_COUNT: 0,
CONFIG_KEY_TASK_ID: task_id,
# deque.extend is thread-safe
CONFIG_KEY_SEND: partial(
@@ -539,6 +541,7 @@ def prepare_single_task(
else None
),
configurable={
CONFIG_KEY_GRAPH_COUNT: 0,
CONFIG_KEY_TASK_ID: task_id,
# deque.extend is thread-safe
CONFIG_KEY_SEND: partial(
+6 -5
View File
@@ -221,11 +221,12 @@ class PregelLoop:
self.config = patch_configurable(
self.config, {"checkpoint_ns": "", "checkpoint_id": None}
)
if config["configurable"].get(CONFIG_KEY_GRAPH_COUNT, 0) > 0:
raise ValueError("Detected multiple subgraphs called in a single node.")
else:
# mutate config so that sibling subgraphs can be detected
self.config["configurable"][CONFIG_KEY_GRAPH_COUNT] = 1
if self.is_nested:
if config["configurable"].get(CONFIG_KEY_GRAPH_COUNT, 0) > 0:
raise ValueError("Detected multiple subgraphs called in a single node.")
else:
# mutate config so that sibling subgraphs can be detected
self.config["configurable"][CONFIG_KEY_GRAPH_COUNT] = 1
if (
CONFIG_KEY_CHECKPOINT_MAP in self.config["configurable"]
and self.config["configurable"].get("checkpoint_ns")
@@ -55,7 +55,7 @@ def wait_for(
raise ValueError(f"Callable did not return within {total_time}")
@pytest.skip("This test times out in CI")
@pytest.mark.skip("This test times out in CI")
async def test_nested_tracing():
lt_py_311 = sys.version_info < (3, 11)
mock_client = _get_mock_client()