langchain - 💡(How to fix) Fix configurable field lost in ToolRuntime.config when using tool_interceptors in langchain 1.2.16 (works in 1.2.15)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

After upgrading langchain-core from 1.2.15 to 1.2.16, the configurable field passed in RunnableConfig becomes an empty dict when accessed via ToolRuntime.config inside tool_interceptors. This is a regression between these two versions.

Version Information Working: langchain-core 1.2.15 Broken: langchain-core 1.2.16 Expected Behavior The configurable dict passed to agent.ainvoke() should be accessible in ToolRuntime.config within tool_interceptors, consistent with how it worked in 1.2.15.

Environment langchain-core: 1.2.16 (broken) / 1.2.15 (working) langgraph: 1.1.10 Python: 3.12

Error Message

Error Message and Stack Trace (if applicable)

Root Cause

After upgrading langchain-core from 1.2.15 to 1.2.16, the configurable field passed in RunnableConfig becomes an empty dict when accessed via ToolRuntime.config inside tool_interceptors. This is a regression between these two versions.

Version Information Working: langchain-core 1.2.15 Broken: langchain-core 1.2.16 Expected Behavior The configurable dict passed to agent.ainvoke() should be accessible in ToolRuntime.config within tool_interceptors, consistent with how it worked in 1.2.15.

Environment langchain-core: 1.2.16 (broken) / 1.2.15 (working) langgraph: 1.1.10 Python: 3.12

Fix Action

Fix / Workaround

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Other Dependencies

aiohttp: 3.13.4 anthropic: 0.91.0 blockbuster: 1.5.26 click: 8.3.1 cloudpickle: 3.1.2 cryptography: 44.0.3 dataclasses-json: 0.6.7 filetype: 1.2.0 google-genai: 1.70.0 grpcio: 1.78.0 grpcio-tools: 1.75.1 httpx: 0.28.1 httpx-sse: 0.4.3 json-repair: 0.53.1 jsonpatch: 1.33 jsonschema-rs: 0.29.1 langgraph: 1.1.10 langgraph-checkpoint: 2.1.2 mcp: 1.26.0 numpy: 1.26.4 openai: 1.109.1 opentelemetry-api: 1.40.0 opentelemetry-exporter-otlp-proto-http: 1.40.0 opentelemetry-sdk: 1.40.0 orjson: 3.11.7 packaging: 26.0 protobuf: 6.33.6 pydantic: 2.12.5 pydantic-settings: 2.13.1 pyjwt: 2.12.1 pytest: 8.4.2 python-dotenv: 1.2.2 PyYAML: 6.0.3 pyyaml: 6.0.3 requests: 2.33.0 requests-toolbelt: 1.0.0 rich: 14.3.3 sqlalchemy: 2.0.48 SQLAlchemy: 2.0.48 sse-starlette: 2.1.3 starlette: 0.46.2 structlog: 25.5.0 tenacity: 9.1.4 tiktoken: 0.12.0 truststore: 0.10.4 typing-extensions: 4.15.0 urllib3: 2.6.3 uuid-utils: 0.14.1 uvicorn: 0.35.0 vcrpy: 8.1.1 watchfiles: 1.1.1 wcmatch: 10.1 xxhash: 3.6.0 zstandard: 0.25.0

Code Example

import asyncio
from typing import Any
from langchain_core.runnables import RunnableConfig
from langchain_core.messages import HumanMessage
from langgraph.prebuilt import ToolNode, create_react_agent
from langgraph.types import Command, ToolRuntime
from langchain_core.tools import tool

# Step 1: Define a simple tool
@tool
def get_db_config(db_config_id: str) -> str:
    """Get database config by ID"""
    return f"db_config_{db_config_id}"

# Step 2: Define an interceptor that logs the configurable field
async def logging_interceptor(
    request: Any,  # MCPToolCallRequest-like object
    handler: Any
) -> Any:
    # Access the runtime config
    runtime: ToolRuntime = request.runtime
    configurable = runtime.config.get("configurable", {})
    print(f"[interceptor] configurable = {configurable}")
    # This prints {} in 1.2.16, but correctly shows the values in 1.2.15
    return await handler(request)

# Step 3: Create agent with tool_interceptors
tools = [get_db_config]
agent = create_react_agent(
    model=None,  # skip actual LLM call for reproduction
    tools=tools,
    tool_interceptors=[logging_interceptor],
)

# Step 4: Invoke with configurable values
async def main():
    result = await agent.ainvoke(
        {"messages": [HumanMessage(content="hello")]},
        config={
            "configurable": {
                "db_config_id": "my_db",
                "user_id": "user_123"
            }
        }
    )
    # Expected (1.2.15): interceptor prints: configurable = {'db_config_id': 'my_db', 'user_id': 'user_123'}
    # Actual (1.2.16): interceptor prints: configurable = {}

asyncio.run(main())

---
RAW_BUFFERClick to expand / collapse

Submission checklist

  • This is a bug, not a usage question.
  • I added a clear and descriptive title that summarizes this issue.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.
  • The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).
  • This is not related to the langchain-community package.
  • I posted a self-contained, minimal, reproducible example. A maintainer can copy it and run it AS IS.

Package (Required)

  • langchain
  • langchain-openai
  • langchain-anthropic
  • langchain-classic
  • langchain-core
  • langchain-model-profiles
  • langchain-tests
  • langchain-text-splitters
  • langchain-chroma
  • langchain-deepseek
  • langchain-exa
  • langchain-fireworks
  • langchain-groq
  • langchain-huggingface
  • langchain-mistralai
  • langchain-nomic
  • langchain-ollama
  • langchain-openrouter
  • langchain-perplexity
  • langchain-qdrant
  • langchain-xai
  • Other / not sure / general

Related Issues / PRs

No response

Reproduction Steps / Example Code (Python)

import asyncio
from typing import Any
from langchain_core.runnables import RunnableConfig
from langchain_core.messages import HumanMessage
from langgraph.prebuilt import ToolNode, create_react_agent
from langgraph.types import Command, ToolRuntime
from langchain_core.tools import tool

# Step 1: Define a simple tool
@tool
def get_db_config(db_config_id: str) -> str:
    """Get database config by ID"""
    return f"db_config_{db_config_id}"

# Step 2: Define an interceptor that logs the configurable field
async def logging_interceptor(
    request: Any,  # MCPToolCallRequest-like object
    handler: Any
) -> Any:
    # Access the runtime config
    runtime: ToolRuntime = request.runtime
    configurable = runtime.config.get("configurable", {})
    print(f"[interceptor] configurable = {configurable}")
    # This prints {} in 1.2.16, but correctly shows the values in 1.2.15
    return await handler(request)

# Step 3: Create agent with tool_interceptors
tools = [get_db_config]
agent = create_react_agent(
    model=None,  # skip actual LLM call for reproduction
    tools=tools,
    tool_interceptors=[logging_interceptor],
)

# Step 4: Invoke with configurable values
async def main():
    result = await agent.ainvoke(
        {"messages": [HumanMessage(content="hello")]},
        config={
            "configurable": {
                "db_config_id": "my_db",
                "user_id": "user_123"
            }
        }
    )
    # Expected (1.2.15): interceptor prints: configurable = {'db_config_id': 'my_db', 'user_id': 'user_123'}
    # Actual (1.2.16): interceptor prints: configurable = {}

asyncio.run(main())

Error Message and Stack Trace (if applicable)

Description

Description

After upgrading langchain-core from 1.2.15 to 1.2.16, the configurable field passed in RunnableConfig becomes an empty dict when accessed via ToolRuntime.config inside tool_interceptors. This is a regression between these two versions.

Version Information Working: langchain-core 1.2.15 Broken: langchain-core 1.2.16 Expected Behavior The configurable dict passed to agent.ainvoke() should be accessible in ToolRuntime.config within tool_interceptors, consistent with how it worked in 1.2.15.

Environment langchain-core: 1.2.16 (broken) / 1.2.15 (working) langgraph: 1.1.10 Python: 3.12

System Info

System Information

OS: Darwin OS Version: Darwin Kernel Version 25.3.0: Wed Jan 28 20:54:55 PST 2026; root:xnu-12377.91.3~2/RELEASE_ARM64_T8132 Python Version: 3.12.0 (main, Dec 9 2025, 11:52:34) [Clang 17.0.0 (clang-1700.4.4.1)]

Package Information

langchain_core: 1.3.3 langchain: 1.2.15 langchain_community: 0.4.1 langsmith: 0.6.9 deepagents: 0.4.8 langchain_anthropic: 1.4.0 langchain_classic: 1.0.3 langchain_google_genai: 4.2.1 langchain_mcp_adapters: 0.2.2 langchain_openai: 1.1.9 langchain_protocol: 0.0.15 langchain_qwq: 0.3.4 langchain_text_splitters: 1.1.1 langgraph_api: 0.4.48 langgraph_cli: 0.2.12 langgraph_runtime_inmem: 0.14.1 langgraph_sdk: 0.3.12

Optional packages not installed

deepagents-cli

Other Dependencies

aiohttp: 3.13.4 anthropic: 0.91.0 blockbuster: 1.5.26 click: 8.3.1 cloudpickle: 3.1.2 cryptography: 44.0.3 dataclasses-json: 0.6.7 filetype: 1.2.0 google-genai: 1.70.0 grpcio: 1.78.0 grpcio-tools: 1.75.1 httpx: 0.28.1 httpx-sse: 0.4.3 json-repair: 0.53.1 jsonpatch: 1.33 jsonschema-rs: 0.29.1 langgraph: 1.1.10 langgraph-checkpoint: 2.1.2 mcp: 1.26.0 numpy: 1.26.4 openai: 1.109.1 opentelemetry-api: 1.40.0 opentelemetry-exporter-otlp-proto-http: 1.40.0 opentelemetry-sdk: 1.40.0 orjson: 3.11.7 packaging: 26.0 protobuf: 6.33.6 pydantic: 2.12.5 pydantic-settings: 2.13.1 pyjwt: 2.12.1 pytest: 8.4.2 python-dotenv: 1.2.2 PyYAML: 6.0.3 pyyaml: 6.0.3 requests: 2.33.0 requests-toolbelt: 1.0.0 rich: 14.3.3 sqlalchemy: 2.0.48 SQLAlchemy: 2.0.48 sse-starlette: 2.1.3 starlette: 0.46.2 structlog: 25.5.0 tenacity: 9.1.4 tiktoken: 0.12.0 truststore: 0.10.4 typing-extensions: 4.15.0 urllib3: 2.6.3 uuid-utils: 0.14.1 uvicorn: 0.35.0 vcrpy: 8.1.1 watchfiles: 1.1.1 wcmatch: 10.1 xxhash: 3.6.0 zstandard: 0.25.0

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING