diff --git a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py index 3b8bcac06..25a8b41a9 100644 --- a/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py +++ b/libs/langgraph/langgraph/prebuilt/chat_agent_executor.py @@ -77,19 +77,8 @@ def _get_state_modifier_runnable( ) elif callable(state_modifier): # Inspect the state_modifier signature - sig = inspect.signature(state_modifier) - - if store is not None and "store" not in sig.parameters: - raise ValueError( - "State modifier callable needs to accept 'store' as a parameter when using create_react_agent with a store." - ) - elif store is None and "store" in sig.parameters: - raise ValueError( - "Please pass 'store' to create_react_agent to use 'store' in state modifier." - ) - - state_modifier_runnable = RunnableLambda( - state_modifier, name=STATE_MODIFIER_RUNNABLE_NAME + state_modifier_runnable = RunnableCallable( + state_modifier, name=STATE_MODIFIER_RUNNABLE_NAME, trace=True ) elif isinstance(state_modifier, Runnable): state_modifier_runnable = state_modifier diff --git a/libs/langgraph/tests/__snapshots__/test_pregel.ambr b/libs/langgraph/tests/__snapshots__/test_pregel.ambr index bc6bfac9a..067839720 100644 --- a/libs/langgraph/tests/__snapshots__/test_pregel.ambr +++ b/libs/langgraph/tests/__snapshots__/test_pregel.ambr @@ -4841,10 +4841,10 @@ "type": "runnable", "data": { "id": [ - "langchain_core", - "runnables", - "base", - "RunnableLambda" + "langgraph", + "utils", + "runnable", + "RunnableCallable" ], "name": "agent" }