pypi / langchain
langchain
What changed in langchain 0.3 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-19.
11 breaking12 security4 deprecations73 new APIs and options1 performance14 behavior and defaults2 tooling77 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlangchain 1179 changes
Breaking changes 11
The minimum core dependency requirement was updated.
The ls_agent_type tag on create_agent calls was reverted.
Raises the minimum required core versions.
Pygments is updated across packages in response to CVE-2026-4539.
Approximate token counting is improved.
Updates the summarization prompt, which may change summarization behavior.
Input state no longer contains todos.
ToolNode support is removed from create_agent.
Renames create_react_agent to create_agent.
Adds todo middleware under the TodoListMiddleware name.
Removes ToolNode from agents.
Security 6
Cache settings are sanitized for fallback models.
Prevents approval gates from silently failing open.
Anthropic cache markers are sanitized on fallback retries.
Anthropic allowed_prefixes are tightened, affecting which prefixes are permitted.
File-search results are confined, limiting results to the intended scope.
Redacts streamed PII in flight.
Deprecations 3
A notice is added to ToolMessage.
hub in langchain-classic was deprecated.
Using setattr on ModelCallRequest is deprecated.
New APIs and options 69
HITL middleware adds opt-in per-call interrupts, allowing developers to enable interrupts for individual calls.
SummarizationMiddleware now accepts summarizer, allowing developers to provide a summarizer.
Adds MCPAdapter and the langchain.mcp namespace for working with MCP.
Supports a custom token_counter in ContextEditingMiddleware.
Adds standard model exception types for handling model errors.
Exposes trace_policy on AgentMiddleware so developers can configure its trace policy.
Adds LangSmith as a provider supported by init_chat_model.
Adds reasoning_effort as a standard chat model parameter.
Adds a state_schema parameter to wrap_tool_call for specifying the tool call's state schema.
Adds ToolErrorMiddleware.
Adds support for explicit prompt caching in the OpenAI integration.
Supports langchain-meta in init_chat_model.
Adds the meta extra for installing langchain-meta support.
Adds ProviderToolSearchMiddleware to LangChain.
The OpenAI integration now supports the apply_patch built-in tool.
Adds interrupt_mode to HumanInTheLoopMiddleware.
Adds a when predicate to HumanInTheLoopMiddleware.
Subagent runs are projected onto a typed run.subagents channel.
Stream transformers can now be registered on middleware.
Agent stream_events and astream_events support version="v3", providing typed projections for messages, tool calls, state, and other stream updates.
Adds the respond decision to HITL middleware.
Adds content-block-centric streaming (v2) for working with streamed content blocks.
Adds the ls_agent_type tag to create_agent calls.
Adds baseten to the built-in providers.
Adds LangSmith integration metadata to create_agent, giving developers metadata for LangSmith integration.
Adds LangSmith integration metadata to init_chat_model, giving developers metadata for LangSmith integration.
Tracing is added for wrap model and tool call operations.
A provider package for OpenRouter is available.
OpenAI supports automatic server-side compaction.
ToolCallRequest is now available from the middleware exports.
Middleware can dynamically register tools.
Adds metadata configuration to summarization model invocation, allowing developers to configure metadata for that invocation.
Agent name metadata was added, allowing agent names to be represented in metadata.
Adds support for the google_genai provider in init_embeddings.
Added extras to BaseTool.
Added a strict flag to ProviderStrategy structured output.
AIMessage supports an agent name.
Anthropic support adds the effort option.
init_chat_model supports Upstage (Solar).
Adds ModelRetryMiddleware.
SummarizationMiddleware now supports asynchronous summarization.
SummarizationMiddleware can use model context windows when deciding when to trigger summarization.
create_agent's system_prompt now supports SystemMessage, allowing developers to provide a system message directly.
model-profiles is available as an optional dependency.
Support was added for structured output retry middleware.
UsageMetadata is now exported for developers to use.
Adds an after_agent middleware hook.
Adds a before_agent middleware hook.
Adds ClaudeBashToolMiddleware for use with agents.
Adds context editing middleware.
Adds async support to create_agent.
Adds middleware support to create_agent.
Adds a decorator pattern for dynamically generated middleware.
Adds file-search middleware.
Adds middleware for selecting an LLM.
Adds model call limits.
Adds ModelFallbackMiddleware and a retry_model_request middleware hook.
Adds an override to model requests.
Adds PIIMiddleware.
Adds support for representing server side tools in model requests and updates tool handling.
Adds ShellToolMiddleware for use with agents.
Adds stuff and map reduce chains.
Adds middleware for retrying tool calls.
Adds middleware for limiting tool calls.
Adds an override to tool call requests.
Adds a tool emulator.
ToolRuntime can be injected into tools, including as the generic ToolRuntime[ContextT, StateT].
Adds asynchronous implementations for wrap_model_call middleware.
Adds an asynchronous implementation for wrap_tool_call middleware.
Performance 1
Initialization is faster, with a reported 15% reduction.
Behavior and default changes 13
Supports Bedrock Mantle chat models.
Middleware trace inputs are omitted, changing the inputs included in traces.
Filters internal middleware model calls out of the messages projection.
Trigger conditions now support AND-capable combinations in SummarizationMiddleware.
Results are sorted by modification time, newest first.
Context is threaded through create_agent flows and middleware.
wrap_model_call supports state updates using commands.
Summarization is engaged based on reported usage_metadata.
Run IDs use uuid7.
Provider strategy now references model profiles.
The default recursion limit was increased.
Fixes the default for ToolRuntime args.
Tool node error handlers can use PEP 604 union types.
Tooling 2
Overloads were added to create_agent, improving its type signatures for developers.
Adds a developer experience for dynamic prompts.
Fixes and other changes 74
Retries the summary step on context overflow.
Repairs invalid tool calls.
GPT-6 structured output is recognized without profiles.
Model-generated tool calls are preserved when editing tool calls in HITL.
Preserves open MCP object arguments.
Includes the model destination when routing agent tools.
Indexing in genai v1 streaming content was shored up.
Redaction now preserves the content-block shape.
Custom HITL rejection reasons are now framed correctly.
Preserves the ordering of repeated schemas in the final result.
Re-raises non-retryable exceptions instead of retrying them.
Adds aliases for Bedrock Mantle chat models.
Handles an import error involving model, preventing that error from disrupting LLMToolEmulator use.
Propagates control flow from model middleware.
Re-exports PIIMatch from the middleware package, making it available through that package.
Handles malformed structured-output responses.
Clears stale structured_response values between checkpointed turns.
Preserves history when summarization fails, avoiding loss of conversation history after a summary failure.
Prevents orphaned tool_calls in the middleware's end behavior.
Restricts narrowed ToolStrategy values in bound tools.
Retries only retryable exceptions, avoiding retries for exceptions that should not be retried.
Shell middleware no longer triggers a shared process-group kill.
Interrupts now propagate through ToolRetryMiddleware.
Only sets strict=True on tools for OpenAI-compatible models, avoiding strict mode for other providers.
Provider strategy detection now handles dated gpt-5.2 and gpt-5.4 snapshots.
The summary format was switched; the notes do not specify further details.
Typing support for async middleware decorators was fixed.
Structured output model fallbacks were tightened, changing when fallback models are used.
Preserves compatibility for summarization triggers.
Improves guidance provided when a human-in-the-loop action is rejected.
The final answer now lands in the last AIMessage.
Bedrock providers are aliased in the summarization token check.
Model provider classes are updated for Azure AI Foundry.
ChatAnthropicVertex is now recognized by the approximate token counter.
The recursion limit is updated for create_agent, including runtime recursion limit overrides.
Missing ModelProfile fields are added, and schema drift now triggers a warning.
Exports Runtime from agents.middleware so developers can import it from that module.
Adds type: message to Responses API input items.
Custom detector output is normalized to prevent KeyError in hash and mask strategies.
Supports anthropic-bedrock, allowing it to be used with init_chat_model.
Model errors raised by init_chat_model are more descriptive.
Gemini 3 models can use ProviderStrategy with tools.
Fixes token counting for partial message sequences.
Avoids an UnboundLocalError when no AIMessage exists.
Middleware response_format overrides now normalize raw schemas.
The agent factory reuses ToolStrategy to prevent name mismatches.
Fixed the signature mismatch and config invocation for SummarizationMiddleware.
Errors are more descriptive when a dependency is not installed.
Provider inference now handles mixed-case prefixes.
Messages generated from summarization are now tagged.
Summarization keeps tool call and AIMessage pairings intact.
Fixes a copy-paste error in the azure_openai embedding provider map.
Planning middleware now handles parallel usage of the todo tool.
Improves validation in init_chat_model.
Message summarization now uses get_buffer_string to format messages.
Resolves a race condition in ShellSession.execute().
Injected arguments are excluded from tool schemas.
Fixed helper logic for using init_chat_model with the HuggingFace backend.
Added a sentinel value for strict mode in ProviderStrategy.
Fixed a multithreading race condition affecting shell output.
Types were added to the human-in-the-loop middleware.
Token counts are adjusted based on the model.
Adds missing async hooks.
Adds filesystem middleware in init.
Restores backward compatibility for response_format.
Fixes create_agent response_format handling for the Responses API.
The resumable shell now works with interrupts.
HITL middleware no longer reorders tool calls.
Conditional edges are no longer traced.
Thread count is incremented only after successful executions.
Tool call limit middleware is more robust.
Non-LLM-controllable parameters are removed from the tool message when tool invocation fails.
LangChain v1 adds Python 3.14 support.
Adds state_schema back to create_agent.
langchain 0.315 changes
Security 6
The dumps implementation was hardened in the 0.3 release line.
LangSmith SDK: Public prompt pull deserializes untrusted manifests without trust boundary warning
The loads implementation was hardened in the 0.3 release line.
Deserialization is restricted in langchain.storage._lc_store.
load() is hardened against untrusted manifests.
A ReDoS vulnerability in the MRKL and ReAct action regex was patched.
Deprecations 1
The hub API is deprecated.
New APIs and options 4
Anthropic chat model initialization accepts
context_management.The OpenAI integration adds support for
minimal.A function removes ANSI escape sequences.
The OpenAI integration adds support for
verbosity.
Behavior and default changes 1
Usage streaming is enabled when using the default base URL and client.
Fixes and other changes 3
OpenAI
ainvokeuses the asynchronous_aget_responsemethod.The method preserves the supplied LLM.
The model initializer handles the gpt-5 model name.