From d7194383075d8d8aed67bae4b9fe500951cdedfa Mon Sep 17 00:00:00 2001 From: Emmanuel Ferdman Date: Tue, 10 Jun 2025 23:54:01 +0300 Subject: [PATCH] fix: throw exception on multiple injections (#5033) Throw exception on for multiple injections Signed-off-by: Emmanuel Ferdman --- libs/prebuilt/langgraph/prebuilt/tool_node.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/prebuilt/langgraph/prebuilt/tool_node.py b/libs/prebuilt/langgraph/prebuilt/tool_node.py index b2c7cf8d0..384e8acd0 100644 --- a/libs/prebuilt/langgraph/prebuilt/tool_node.py +++ b/libs/prebuilt/langgraph/prebuilt/tool_node.py @@ -850,7 +850,7 @@ def _get_store_arg(tool: BaseTool) -> Optional[str]: if _is_injection(type_arg, InjectedStore) ] if len(injections) > 1: - ValueError( + raise ValueError( "A tool argument should not be annotated with InjectedStore more than " f"once. Received arg {name} with annotations {injections}." )