- _BackendProtocol: private Protocol with core backend methods (read/write/ls etc.)
- AgentRuntime.backend: _BackendProtocol | None — typed at the langchain layer
- create_agent accepts backend= and threads it into AgentRuntime at dispatch time
- No AgentRuntime subclass or BackendMiddleware needed in subpackages
- _build_runtime calls now chain across all middlewares before dispatch
instead of being called per-middleware independently
- create_agent accepts backend= (object|None); passed to AgentRuntime
- AgentRuntime gains backend: object|None field + from_runtime param
- ModelRequest drops duplicated fields; model/system_prompt/tools/etc
are now properties that delegate to runtime, eliminating redundancy
- _wrap_hook/_wrap_async_hook no longer take a mw argument
AgentRuntime gains model_name and tools fields populated by create_agent at
wire time. A private _build_runtime hook on AgentMiddleware lets subpackages
(e.g. deepagents) return an enriched runtime subclass from their middleware
without exposing those fields in LangChain. All four middleware hook nodes
(before_agent, before_model, after_model, after_agent) now receive AgentRuntime
instead of the bare LangGraph Runtime; existing Runtime annotations remain
valid via Liskov substitution.
if "url" in annotation: in Line 15 , already ensures "url" is key in
annotation , so no need to check again to set "url" key in out object
---------
Co-authored-by: Mason Daugherty <mason@langchain.dev>
The LLM shouldn't be seeing parameters it cannot control in the
ToolMessage error it gets when it invokes a tool with incorrect args.
This fixes the behavior within langchain to address immediate issue.
We may want to change the behavior in langchain_core as well to prevent
validation of injected arguments. But this would be done in a separate
change
added some noqas, this is a quick patch to support a bug uncovered in
the quickstart, will resolve fully depending on where we centralize
ToolNode stuff.
**Description:** Added a beginner-friendly tip to the README to help
first-time contributors find a starting point. This is a documentation
improvement aimed at lowering the barrier for newcomers to participate
in open source.
**Issue:** No related issue
**Dependencies:** None
---
## Note to maintainers
I'm new to open source and this is my first PR! If there's anything that
needs improvement, please guide me and I'll be happy to learn and make
changes. Thank you for your patience! 😊
## What does this PR do?
- Added a noticeable beginner tip box after the badges section in README
- Provided specific guidance (Good First Issues link)
- Encourages newcomers to start with documentation fixes
## Why is this change needed?
- Makes it easier for new contributors to get started
- Provides clear direction and reduces confusion
- Creates a more welcoming open source community environment
---------
Co-authored-by: Mason Daugherty <mason@langchain.dev>
* The dependency is not used.
* It takes a long time to build in Python 3.14 as there are no prebuilt
binaries yet. This slows down CI a lot.
Co-authored-by: Mason Daugherty <mason@langchain.dev>