Repository: langchain-ai/langgraph
Issue category: Bug Report

Issue:
Langgraph 0.2.58 resulted in empty config passed to tools in langgraph
### Checked other resources

- [X] This is a bug, not a usage question. For questions, please use GitHub Discussions.
- [X] I added a clear and detailed title that summarizes the issue.
- [X] I read what a minimal reproducible example is (https://stackoverflow.com/help/minimal-reproducible-example).
- [X] I included a self-contained, minimal example that demonstrates the issue INCLUDING all the relevant imports. The code run AS IS to reproduce the issue.

### Example Code

```python
# Graph setup  
    async with get_checkpoints_pool().connection() as conn:
        checkpointer = AsyncPostgresSaver(conn=conn)  # type: ignore
        graph.checkpointer = checkpointer
        runnable_config = RunnableConfig(
            configurable={
                "thread_id": str(conversation_id),
                ... # other fields 

            },
            recursion_limit=80,
        )

        try:
            events = graph.astream(
                {"messages": ("user", message_content)},
                runnable_config,
                stream_mode="updates",
            )

...

# typical tool 
@tool
async def some_tool(input: str, config: RunnableConfig):
    thread_id = config.get("configurable", {}).get("thread_id") # <--- this returns nothing
```


### Error Message and Stack Trace (if applicable)

_No response_

### Description

Today, a change to our poetry lock file resulted in our CI installing the latest minor version of langgraph, going from 0.2.39 to 0.2.58.
Our application passes in the RunnableConfig into each tool, and we use that to get relevant information which is critical for each tool. This worked fine before the upgrade, but after upgrading to 0.2.58 the config passed to our tools was suddenly blank. No configurable, no metadata: `{'tags': [], 'metadata': {}, 'callbacks': None, 'recursion_limit': 25, 'configurable': {}}`

When going back to 0.2.39 the issue is not there, and the config contains all data we pass in when initializing the graph.
Isolating only installing either 0.2.39 or 0.2.58 toggles the error, and results in the following dependencies also changing (we suspect it might be related to the checkpointer)

```
poetry add langgraph@0.2.58

Updating dependencies
Resolving dependencies... (2.0s)

Package operations: 0 installs, 4 updates, 1 removal

  - Removing httpx-sse (0.4.0)
  - Updating langchain-core (0.3.13 -> 0.3.24)
  - Updating langgraph-checkpoint (2.0.2 -> 2.0.8)
  - Updating langgraph-sdk (0.1.35 -> 0.1.43)
  - Updating langgraph (0.2.39 -> 0.2.58)

Writing lock file
```

I know the example is not reproducible, but it was too much work to actually set up an example given db dependencies etc, so I hope the provided example illustrates well enough what the issue is. I still wanted to report this however, as it was a huge breaking change for us, which definitely should not be the case with a minor upgrade. 

### System Info


System Information (0.2.58)
------------------
> OS:  Darwin
> OS Version:  Darwin Kernel Version 23.6.0: Thu Sep 12 23:35:29 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6000
> Python Version:  3.10.13 (main, Sep 11 2023, 15:00:52) [Clang 14.0.0 (clang-1400.0.29.202)]

Package Information
-------------------
> langchain_core: 0.3.24
> langchain: 0.3.4
> langchain_community: 0.3.3
> langsmith: 0.1.137
> langchain_anthropic: 0.1.20
> langchain_openai: 0.2.4
> langchain_text_splitters: 0.3.0
> langchainhub: 0.1.21
> langgraph_sdk: 0.1.43

Optional packages not installed
-------------------------------
> langserve

Other Dependencies
------------------
> aiohttp: 3.10.10
> anthropic: 0.28.1
> async-timeout: 4.0.3
> dataclasses-json: 0.6.7
> defusedxml: 0.7.1
> httpx: 0.27.2
> jsonpatch: 1.33
> numpy: 1.26.4
> openai: 1.52.2
> orjson: 3.10.10
> packaging: 24.1
> pydantic: 2.9.2
> pydantic-settings: 2.6.0
> PyYAML: 6.0.2
> requests: 2.32.3
> requests-toolbelt: 1.0.0
> SQLAlchemy: 2.0.36
> tenacity: 9.0.0
> tiktoken: 0.7.0
> types-requests: 2.32.0.20241016
> typing-extensions: 4.12.2


----------------------



System Information (0.2.39)
------------------
> OS:  Darwin
> OS Version:  Darwin Kernel Version 23.6.0: Thu Sep 12 23:35:29 PDT 2024; root:xnu-10063.141.1.701.1~1/RELEASE_ARM64_T6000
> Python Version:  3.10.13 (main, Sep 11 2023, 15:00:52) [Clang 14.0.0 (clang-1400.0.29.202)]

Package Information
-------------------
> langchain_core: 0.3.13
> langchain: 0.3.4
> langchain_community: 0.3.3
> langsmith: 0.1.137
> langchain_anthropic: 0.1.20
> langchain_openai: 0.2.4
> langchain_text_splitters: 0.3.0
> langchainhub: 0.1.21
> langgraph: 0.2.39

Optional packages not installed
-------------------------------
> langserve

Other Dependencies
------------------
> aiohttp: 3.10.10
> anthropic: 0.28.1
> async-timeout: 4.0.3
> dataclasses-json: 0.6.7
> defusedxml: 0.7.1
> httpx: 0.27.2
> jsonpatch: 1.33
> langgraph-checkpoint: 2.0.2
> langgraph-sdk: 0.1.35
> numpy: 1.26.4
> openai: 1.52.2
> orjson: 3.10.10
> packaging: 24.1
> pydantic: 2.9.2
> pydantic-settings: 2.6.0
> PyYAML: 6.0.2
> requests: 2.32.3
> requests-toolbelt: 1.0.0
> SQLAlchemy: 2.0.36
> tenacity: 9.0.0
> tiktoken: 0.7.0
> types-requests: 2.32.0.20241016
> typing-extensions: 4.12.2



Hints:
How are you invoking the tools?
We bind the tools to a gpt-4-o agent
```python
llm = AzureChatOpenAI(
            azure_deployment="gpt4o",
            api_version="2024-06-01",
            temperature=0,
            timeout=120,
)

self.runnable = prompt | llm.bind_tools(tools)
runnable_input = {
    **state,
    "company": company,
}

result: AIMessage = await self.runnable.ainvoke(runnable_input)  # type: ignore
```


We're experiencing the same problem.
Actually, the breaking change is in `0.2.57` (also released yesterday), `0.2.56` works as expected.
ah, it's a `langchain-core` issue, cc @baskaryan . we will investigate!

Patch:
diff --git a/libs/langgraph/langgraph/prebuilt/tool_node.py b/libs/langgraph/langgraph/prebuilt/tool_node.py
index d3d0751e2..e2ac50b8e 100644
--- a/libs/langgraph/langgraph/prebuilt/tool_node.py
+++ b/libs/langgraph/langgraph/prebuilt/tool_node.py
@@ -297,7 +297,7 @@ def _run_one(
 
         try:
             input = {**call, **{"type": "tool_call"}}
-            response = self.tools_by_name[call["name"]].invoke(input)
+            response = self.tools_by_name[call["name"]].invoke(input, config)
 
         # GraphInterrupt is a special exception that will always be raised.
         # It can be triggered in the following scenarios:
@@ -352,7 +352,7 @@ async def _arun_one(
 
         try:
             input = {**call, **{"type": "tool_call"}}
-            response = await self.tools_by_name[call["name"]].ainvoke(input)
+            response = await self.tools_by_name[call["name"]].ainvoke(input, config)
 
         # GraphInterrupt is a special exception that will always be raised.
         # It can be triggered in the following scenarios:


Test patch: