npm / langchain
langchain
What changed in langchain 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
16 breaking4 security28 new APIs and options11 behavior and defaults1 tooling49 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initlangchain 1109 changes
Breaking changes 16
In both modes, setting tool to true allows every decision, including respond.
Respects retryability marks by default and stops retrying once a non-retryable error is found; unclassified errors retain the previous retry behavior.
Aborted calls, context overflow, and oversized payloads are marked non-retryable out of the box, so they fail without consuming retry budgets.
Passing retryOn: () => true restores the previous retry behavior for errors marked non-retryable.
Respects retryability marks by default and stops retrying once a non-retryable error is found; unclassified errors retain the previous retry behavior.
Middleware-internal model calls and summaries are no longer projected as messages in run.messages or message streams; they remain observable through v2 stream events via lc_source.
Throws StructuredOutputParsingError when a terminal providerStrategy response cannot be parsed or does not satisfy the schema; tool calls can still continue the agent loop.
Fireworks is extracted into a standalone provider package.
A standalone Perplexity provider package is available.
Together AI is migrated into a provider package.
Renamed getSubgraphAsync to getSubgraphsAsync.
The afterModel router now respects the tool behavior version: v1 routes the full AIMessage to one ToolNode invocation, while v2 dispatches each tool call as a separate Send task.
fakeModel moved from utils/testing to the testing namespace, so update imports to use the updated namespace.
The default model changes to claude-sonnet-4-5-20250929, replacing the retired claude-3-5-sonnet-latest.
Hooks that return void no longer re-emit the input state.
strict now defaults to true in providerStrategy for OpenAI compatibility.
Security 4
Middleware hook input state is derived from the current invocation state instead of cross-node cached state, preventing state from leaking across threads.
LangChain serialization injection vulnerability enables secret extraction
Security hardening was added for load.
Prevents summarization middleware from leaking streaming events.
New APIs and options 28
Adds opt-in per_call mode, which raises a separate tool_approval interrupt for each gated tool call, answered by interrupt ID; respond is supported.
Adds Interrupt.response_schema.
Adds an API to read an error's retryability mark; it returns undefined when an error has not been classified.
Models accept a per-call maxRetries value so a surrounding retry loop can take over.
Adds an API to mark errors as retryable or non-retryable without changing their class or shape, allowing provider SDK errors and tool failures to be classified.
initChatModel now supports the LangSmith gateway.
Adds middleware for handling tool execution errors.
V3 runs expose named nested agents invoked from tools through run.subagents, with scoped messages, tool calls, and output.
Adds a typed stream handle for named nested agents, exposing name, cause, scoped messages and tool calls, and output.
Adds middleware that makes a best-effort attempt to use prompt caching features for supported Bedrock models.
Adds an optional when callback that dynamically skips interrupts for specific tool calls by deciding whether to interrupt or auto-approve.
LangChain adds support for browser tools.
initChatModel adds support for ChatGoogle.
Adds support for dynamic structured output.
LangSmith integration metadata is added to createAgent and initChatModel.
Adds a browser export for LangChain, allowing browser-specific module resolution.
Adds Vitest matchers for LangChain message and tool call assertions, registerable with expect.extend; the matchers are also re-exported from langchain.
Structured output now supports standard schemas.
Added a getter/setter that forwards store access to the internal compiled graph.
Adds an optional tools parameter for more accurate token estimates when tools are bound to a model.
Adds an optional modelProvider parameter for direct config lookup, avoiding className collisions while preserving callers that pass only className.
Adds a ReactAgent method for setting default configuration values that merge with invocation-time config.
Summarization model calls are tagged with lc_source metadata, allowing developers to identify their source.
Agent generics now use a type bag pattern with AgentTypeConfig, MiddlewareTypeConfig, and helper types for type extraction.
Prompt pulling now supports secrets.
Prompt pulling now supports secretsFromEnv.
The stream API now supports the callbacks property.
Allows developers to set the strict tag manually in providerStrategy.
Behavior and default changes 11
Error ToolMessages from the tool node carry status: "error"; a ToolMessage returned by a custom handleToolErrors function defaults to that status if none is set.
A custom onFailedAttempt handler replaces the built-in handler and opts out of automatic error marking.
Tool-call streams now treat any serialized graph interrupt as control flow, keeping the call pending so it can resume instead of rejecting its output promise.
Adds ls_agent_type to tracing metadata when creating agent runs.
Accepts cross-version runnable models.
Dynamic tools can be used in wrapModelCall with wrapToolCall.
Store and configurable are now propagated to the ToolNode middleware runtime.
The middleware runtime now receives configurable from the LangGraph config.
Middleware hooks can return Command objects for advanced control flow, matching the existing wrapToolCall pattern.
Summarization middleware messages now include the lc_source tag.
Adds support for anyOf, allOf, and oneOf in OpenAPI conversion.
Tooling 1
Type inference is implemented for tool streams, allowing developers to infer their types.
Fixes and other changes 49
Edits in per_call mode are pinned to the called tool and checked against the input side of its Zod v4 schema, so transforms run once when the tool does; invalid answers throw without being saved.
With middleware, createAgent now passes a Command built by a different copy of @langchain/langgraph to the graph as-is instead of merging it into the input state as a plain object.
Preserves LangGraph interrupts instead of retrying them or converting them into tool errors, allowing interrupted tool calls to pause and resume through their checkpointer.
A failed returnDirect tool call, including one with arguments that fail the tool schema, now returns to the model for correction and retry; the run ends on the first successful returnDirect result.
Callbacks are preserved when the compiled graph is extracted, without duplicate calls through the agent.
Structured-output parsing now ignores thought/reasoning text blocks.
The gateway now uses a unified endpoint.
Runtime instance comparisons now use the same logic as .isInstance(), avoiding conflicts when multiple versions of core are installed.
Resolves LocalFileStore keys with path.relative.
Malformed tool input schemas are unrecoverable.
Strict tools are decoupled from strict structured output responses.
Tool message outputs are unwrapped in agent streams.
ToolMessages produced by todoListMiddleware now have a name set.
Prevents llmToolSelectorMiddleware from leaking into the message stream.
Prevents local file corruption when using LocalFileStore.
createAgent and prebuilt middleware are now exported from the browser entry point, making them available to browser users.
Reverting the Zod import in utils.ts fixes interoperability between Zod v3 and v4.
Adds the aws alias so hub/node can auto-detect ChatBedrockConverse from Python-serialized prompts.
Structured output using providerStrategy is supported for Google Gemini models in createAgent.
Fixes routing when an agent combines returnDirect tools with beforeModel middleware, preventing non-returnDirect tools from failing with an unknown or null destination.
Serializable schemas are now exposed on the create agent response format.
The todo schema is now exported for developers to use.
Structured output retry Commands are now propagated through wrapModelCall middleware.
Added a getter/setter that forwards checkpointer access to the internal compiled graph, fixing ignored LangGraph API server checkpointer injection and lost thread state across restarts.
The middleware runtime now receives store from the LangGraph config; previously, runtime.store was always undefined even when a store was provided to createAgent().
Middleware hooks now infer StateSchema value types correctly.
The shared currentSystemMessage is reset when a middleware handler retries.
Export the ModelRequest interface so developers can import and use it.
Persist underscore-prefixed middleware state fields across graph steps.
Fixed streaming types.
Fixed structured output on opus.
Subagent names are now propagated in metadata.
Supports concurrent dynamic prompts in agentNode.
Pregel keys are filtered from the cache key to avoid out-of-memory errors.
StateSchema is now supported in the middleware pipeline.
Middleware state parsing now correctly handles both Zod objects and LangGraph's StateSchema.
Graph interrupt errors are now bubbled up as-is.
Middleware errors use cause instead of concatenating the error, preserving the underlying cause.
createAgent state schemas now preserve reducer metadata.
Models now make only one write_todo call at a time.
The afterModel Router now uses parseJumpToTarget.
Message summarization now uses getBufferString, changing how messages are converted to summary input.
Summarization now preserves tool call and AIMessage pairings.
The schema title is now passed through properly.
Interop with Zod is improved.
Prevents functions from being accidentally assignable to AgentMiddleware.
Fixes patch prompts created from runs.
Structured output is now properly retrieved from a thinking block.
Uses summaryPrefix or falls back to the default prefix.