Hi team
,
I’m seeing a difference in how ToolRuntime / state is handled between Python and JS in LangGraph and wanted clarification.
Observation
-
In Python,
ToolNodeexplicitly supports state injection:“ToolNode … handles … state injection for tools” (LangChain Reference)
and tools can directly access:runtime.state -
In JS,
ToolRuntimedocs say it includes state:“
state: The current graph state” (LangChain Reference)But when using:
new ToolNode(tools)runtime.stateis not populated, and we need to pass state manually viaconfig.configurable.
Questions
-
Is this difference intentional (Python ToolNode = injection, JS ToolNode = execution only)?
-
Is ToolRuntime injection planned for JS ToolNode?
-
What’s the recommended pattern in JS LangGraph?
-
Pass state manually via
config.configurable? -
Or avoid
ToolNodeand usecreateAgentfor runtime injection?
-
Current workaround
tool.invoke(toolCall, {
configurable: { state }
});
But this feels less ergonomic vs Python.
Would appreciate guidance on the intended design + best practice here. Thanks! ![]()