Skip to content

Commit e6cd470

Browse files
authored
fix: Only overwrite thread id on subgraphs when calling remote graph (#168)
1 parent 25500f8 commit e6cd470

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

langgraph_supervisor/supervisor.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
create_react_agent,
1717
)
1818
from langgraph.pregel import Pregel
19+
from langgraph.pregel.remote import RemoteGraph
1920
from langgraph.utils.config import patch_configurable
2021
from langgraph.utils.runnable import RunnableCallable
2122

@@ -93,7 +94,9 @@ def call_agent(state: dict, config: RunnableConfig) -> dict:
9394
patch_configurable(
9495
config,
9596
{"thread_id": uuid5(UUID(str(thread_id)), agent.name) if thread_id else None},
96-
),
97+
)
98+
if isinstance(agent, RemoteGraph)
99+
else config,
97100
)
98101
return _process_output(output)
99102

@@ -104,7 +107,9 @@ async def acall_agent(state: dict, config: RunnableConfig) -> dict:
104107
patch_configurable(
105108
config,
106109
{"thread_id": uuid5(UUID(str(thread_id)), agent.name) if thread_id else None},
107-
),
110+
)
111+
if isinstance(agent, RemoteGraph)
112+
else config,
108113
)
109114
return _process_output(output)
110115

uv.lock

Lines changed: 1 addition & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)