From 7045a23148bfb7c7de825776531d163f22241aaa Mon Sep 17 00:00:00 2001 From: Mason Daugherty Date: Fri, 9 Jan 2026 21:26:39 -0500 Subject: [PATCH] fix: add `state` attribute to `ToolCallRequest` overrides (#6668) Following https://github.com/langchain-ai/langchain/pull/34692 --- libs/prebuilt/langgraph/prebuilt/tool_node.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/prebuilt/langgraph/prebuilt/tool_node.py b/libs/prebuilt/langgraph/prebuilt/tool_node.py index fee99c85a..aee8f8b02 100644 --- a/libs/prebuilt/langgraph/prebuilt/tool_node.py +++ b/libs/prebuilt/langgraph/prebuilt/tool_node.py @@ -121,6 +121,7 @@ class _ToolCallRequestOverrides(TypedDict, total=False): """Possible overrides for ToolCallRequest.override() method.""" tool_call: ToolCall + state: Any @dataclass @@ -170,8 +171,12 @@ class ToolCallRequest: This follows an immutable pattern, leaving the original request unchanged. Args: - **overrides: Keyword arguments for attributes to override. Supported keys: - - tool_call: Tool call dict with name, args, and id + **overrides: Keyword arguments for attributes to override. + + Supported keys: + + - tool_call: Tool call dict with `name`, `args`, and `id` + - state: Agent state (`dict`, `list`, or `BaseModel`) Returns: New ToolCallRequest instance with specified overrides applied.