unstale

npm / langchain

langchain

What changed in langchain 0.3 to 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-12-05.

55 breaking8 security47 new APIs and options2 performance17 behavior and defaults1 tooling60 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

langchain 1188 changes

Breaking changes 55

  • When configurableFields is omitted, ConfigurableModel no longer allows configurable.model or configurable.modelProvider to swap the model at invoke time; pass both fields to retain runtime swapping.

    1.6.7release notes

  • Installed dependencies must use Zod 4.6.6 or newer to exclude versions affected by GHSA-mrhx-c7xc-m3w5; Zod v3 schemas remain supported through the bundled zod/v3 entry point.

    1.6.5release notes

  • Adds middleware that throws ModelRefusalError when the model refuses, rather than ending the run as if it succeeded; the error passes through unwrapped instead of as a MiddlewareError.

    1.6.4release notes

  • A tool that throws GraphDrained now stops the agent run with that error instead of returning an error ToolMessage and allowing the agent to continue.

    1.5.20release notes

  • In both modes, setting tool to true allows every decision, including respond.

    1.5.18release notes

  • Respects retryability marks by default and stops retrying once a non-retryable error is found; unclassified errors retain the previous retry behavior.

    1.5.9release notes

  • Aborted calls, context overflow, and oversized payloads are marked non-retryable out of the box, so they fail without consuming retry budgets.

    1.5.9release notes

  • Passing retryOn: () => true restores the previous retry behavior for errors marked non-retryable.

    1.5.9release notes

  • 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.

    1.5.6release notes

  • Throws StructuredOutputParsingError when a terminal providerStrategy response cannot be parsed or does not satisfy the schema; tool calls can still continue the agent loop.

    1.4.1release notes

  • Fireworks is extracted into a standalone provider package.

    1.3.0release notes

  • A standalone Perplexity provider package is available.

    1.3.0release notes

  • Together AI is migrated into a provider package.

    1.3.0release notes

  • Renamed getSubgraphAsync to getSubgraphsAsync.

    1.2.35release notes

  • 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.

    1.2.34release notes

  • fakeModel moved from utils/testing to the testing namespace, so update imports to use the updated namespace.

    1.2.30release notes

  • The default model changes to claude-sonnet-4-5-20250929, replacing the retired claude-3-5-sonnet-latest.

    1.2.26release notes

  • Hooks that return void no longer re-emit the input state.

    1.2.20release notes

  • strict now defaults to true in providerStrategy for OpenAI compatibility.

    1.2.4release notes

  • Constrained the lower bound of the core peer dependency, affecting which @langchain/core versions satisfy the peer dependency requirement.

    1.1.1release notes

  • The exit behavior was renamed from throw to error.

    1.0.5release notes

  • call is removed; use invoke instead.

    1.0.0upgrade guide

  • predict is removed; use invoke instead.

    1.0.0upgrade guide

  • predictMessages is removed; use invoke instead.

    1.0.0upgrade guide

  • loadAndSplit is removed; use load followed by a text splitter.

    1.0.0upgrade guide

  • addAIChatMessage is removed; use addMessage with AIMessage.

    1.0.0upgrade guide

  • call is removed; use invoke instead.

    1.0.0upgrade guide

  • predict is removed; use invoke instead.

    1.0.0upgrade guide

  • getRelevantDocuments is removed; use invoke instead.

    1.0.0upgrade guide

  • BaseStoreInterface is removed; use specific store implementations.

    1.0.0upgrade guide

  • runMap is removed; use LangSmith tracing APIs.

    1.0.0upgrade guide

  • fromPromptMessages is removed; use fromMessages.

    1.0.0upgrade guide

  • Pass a plain model string or instance and a separate tools list; pre-bound models are not supported.

    1.0.0upgrade guide

  • The prompt parameter is renamed to systemPrompt.

    1.0.0upgrade guide

  • Introduces the standard API for building agents, with customization through middleware.

    1.0.0upgrade guiderelease notes

  • The React agent prebuilt is available from langchain as createAgent, replacing createReactAgent from @langchain/langgraph/prebuilts.

    1.0.0upgrade guide

  • createChatMessageChunkEncoderStream is removed; use the stream method directly.

    1.0.0upgrade guide

  • Package builds use a bundler-based approach instead of raw TypeScript outputs; imports from dist/ need updating to the new module system.

    1.0.0upgrade guide

  • Use middleware to generate dynamic system prompts based on conversation state or runtime context.

    1.0.0upgrade guide

  • getRuntimeEnvironmentSync is removed; use async getRuntimeEnvironment.

    1.0.0upgrade guide

  • Built-in human-in-the-loop middleware supports tool approval decisions configured with interruptOn.

    1.0.0upgrade guide

  • The package namespace is streamlined to essential agent building blocks; legacy functionality is no longer imported from it and has moved to @langchain/classic.

    1.0.0upgrade guide

  • Legacy chains, retrievers, indexing, community exports, and other deprecated functionality move to this package.

    1.0.0upgrade guideupgrade guiderelease notes

  • Post-model hooks are replaced by middleware implementing afterModel, allowing multiple handlers after the model responds.

    1.0.0upgrade guide

  • Pre-model hooks are replaced by middleware implementing beforeModel, allowing multiple handlers to run before the model call.

    1.0.0upgrade guide

  • Dynamic model selection moves to middleware using wrapModelCall to swap models and tools based on state or runtime context.

    1.0.0upgrade guide

  • Configure tool error handling through middleware implementing wrapToolCall.

    1.0.0upgrade guide

  • The streamed agent node name changes from agent to model; update filters or event matching that use the node name.

    1.0.0upgrade guide

  • All LangChain packages require Node.js 22 or higher; Node 18 support is dropped.

    1.0.0upgrade guide

  • Prompted output through custom instructions in responseFormat is removed in favor of toolStrategy and providerStrategy.

    1.0.0upgrade guide

  • RemoteRunnable is no longer supported.

    1.0.0upgrade guide

  • Runnable.bind is removed; use bindTools or other specific binding methods.

    1.0.0upgrade guide

  • Runnable.map is removed; use batch instead.

    1.0.0upgrade guide

  • Built-in summarization middleware is available for summarizing conversation history before a model call.

    1.0.0upgrade guide

  • TraceGroup is removed; use LangSmith tracing instead.

    1.0.0upgrade guide

Security 7

  • Adds middleware that blocks listed tool calls a decision model judges risky.

    1.6.5release notes

  • Middleware hook input state is derived from the current invocation state instead of cross-node cached state, preventing state from leaking across threads.

    1.3.2release notes

  • LangChain serialization injection vulnerability enables secret extraction

    1.2.3security advisory

  • Security hardening was added for load.

    1.2.3release notes

  • Prevents summarization middleware from leaking streaming events.

    1.1.6release notes

  • Adds prebuilt middleware that requires approval for sensitive tool calls.

    1.0.0upgrade guide

  • Adds prebuilt middleware to redact sensitive information before sending it to the model.

    1.0.0upgrade guiderelease notes

New APIs and options 47

  • Adds middleware that picks the agent's model for each run from a decision model's Choice answer.

    1.6.5release notes

  • Adds tracePolicy to control what LangChainTracer sends to LangSmith during middleware lifecycle hook runs.

    1.6.2release notes

  • Adds model-routing middleware for agents.

    1.6.0release notes

  • Adds a beta runnable with typed predicate, choice and score questions.

    1.6.0release notes

  • Adds tool-risk middleware for agents.

    1.6.0release notes

  • 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.

    1.5.18release notes

  • Adds Interrupt.response_schema.

    1.5.18release notes

  • Adds an API to read an error's retryability mark; it returns undefined when an error has not been classified.

    1.5.9release notes

  • Models accept a per-call maxRetries value so a surrounding retry loop can take over.

    1.5.9release notes

  • 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.

    1.5.9release notes

  • initChatModel now supports the LangSmith gateway.

    1.5.7release notes

  • Adds middleware for handling tool execution errors.

    1.5.4release notes

  • V3 runs expose named nested agents invoked from tools through run.subagents, with scoped messages, tool calls, and output.

    1.5.0release notes

  • Adds a typed stream handle for named nested agents, exposing name, cause, scoped messages and tool calls, and output.

    1.5.0release notes

  • Adds middleware that makes a best-effort attempt to use prompt caching features for supported Bedrock models.

    1.4.6release notes

  • Adds an optional when callback that dynamically skips interrupts for specific tool calls by deciding whether to interrupt or auto-approve.

    1.4.6release notes

  • LangChain adds support for browser tools.

    1.3.0release notes

  • initChatModel adds support for ChatGoogle.

    1.3.0release notes

  • Adds support for dynamic structured output.

    1.2.39release notes

  • LangSmith integration metadata is added to createAgent and initChatModel.

    1.2.36release notes

  • Adds a browser export for LangChain, allowing browser-specific module resolution.

    1.2.32release notes

  • Adds Vitest matchers for LangChain message and tool call assertions, registerable with expect.extend; the matchers are also re-exported from langchain.

    1.2.30release notes

  • Structured output now supports standard schemas.

    1.2.29release notes

  • Added a getter/setter that forwards store access to the internal compiled graph.

    1.2.28release notes

  • Adds an optional tools parameter for more accurate token estimates when tools are bound to a model.

    1.2.20release notes

  • Adds an optional modelProvider parameter for direct config lookup, avoiding className collisions while preserving callers that pass only className.

    1.2.18release notes

  • Adds a ReactAgent method for setting default configuration values that merge with invocation-time config.

    1.2.17release notes

  • Summarization model calls are tagged with lc_source metadata, allowing developers to identify their source.

    1.2.11release notes

  • Agent generics now use a type bag pattern with AgentTypeConfig, MiddlewareTypeConfig, and helper types for type extraction.

    1.2.7release notes

  • Prompt pulling now supports secrets.

    1.2.4release notes

  • Prompt pulling now supports secretsFromEnv.

    1.2.4release notes

  • The stream API now supports the callbacks property.

    1.2.4release notes

  • Allows developers to set the strict tag manually in providerStrategy.

    1.1.6release notesrelease notes

  • New TypeScript types provide strong typing for standard content blocks.

    1.0.0upgrade guide

  • Adds a provider-agnostic, type-safe property for accessing reasoning traces, citations, built-in tools, and other content features.

    1.0.0upgrade guideupgrade guide

  • Pass static, read-only configuration through the context config argument instead of config.configurable; the old pattern remains supported.

    1.0.0upgrade guide

  • Adds structured output generation in the main agent loop, allowing models to choose between tools and provider-side structured output without an additional LLM call.

    1.0.0release notes

  • Lets developers implement custom middleware hooks to intercept agent, model, and tool execution.

    1.0.0upgrade guiderelease notes

  • Adds control over error handling for parsing errors and multiple tool calls in structured output.

    1.0.0upgrade guide

  • Adds prebuilt middleware for interrupting agent execution for human approval.

    1.0.0release notes

  • Set LC_OUTPUT_VERSION=v1 to opt in to serializing standard content blocks into the content attribute.

    1.0.0upgrade guide

  • Set outputVersion to v1 to opt in to serializing standard content blocks into the content attribute.

    1.0.0upgrade guide

  • Use providerStrategy for provider-native structured output generation.

    1.0.0upgrade guide

  • Accepts a schema for structured output from an agent, available on the result as structuredResponse.

    1.0.0upgrade guide

  • Introduces standard content blocks as one of the core improvements in the release.

    1.0.0release notes

  • Adds prebuilt middleware to condense conversation history when it gets too long.

    1.0.0upgrade guiderelease notes

  • Use toolStrategy for structured output generated through artificial tool calling.

    1.0.0upgrade guide

Performance 2

  • Parallel tool tasks restore tool and middleware state from graph channels instead of copying full agent state, while retaining support for full-state tasks in older checkpoints.

    1.5.19release notes

  • Structured output is generated in the main loop, can use provider-side structured output, and eliminates an additional LLM call.

    1.0.0upgrade guideupgrade guide

Behavior and default changes 17

  • The function now accepts tool messages.

    1.6.7release notes

  • Tool messages created for reject and respond decisions now include lc_source and lc_data metadata identifying the interrupt decision.

    1.6.7release notes

  • The default todo-list system prompt and tool description now align with Python and guide the agent to deliver a substantive final answer after its last todo update.

    1.5.19release notes

  • 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.

    1.5.14release notes

  • A custom onFailedAttempt handler replaces the built-in handler and opts out of automatic error marking.

    1.5.9release notes

  • 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.

    1.5.1release notes

  • Adds ls_agent_type to tracing metadata when creating agent runs.

    1.3.4release notes

  • Accepts cross-version runnable models.

    1.2.39release notes

  • Dynamic tools can be used in wrapModelCall with wrapToolCall.

    1.2.39release notes

  • Store and configurable are now propagated to the ToolNode middleware runtime.

    1.2.34release notes

  • The middleware runtime now receives configurable from the LangGraph config.

    1.2.28release notes

  • Middleware hooks can return Command objects for advanced control flow, matching the existing wrapToolCall pattern.

    1.2.20release notes

  • Summarization middleware messages now include the lc_source tag.

    1.2.8release notes

  • Adds support for anyOf, allOf, and oneOf in OpenAPI conversion.

    1.1.6release notes

  • Context editing was aligned with the summarization interface.

    1.0.5release notes

  • Summarization middleware now uses profile.maxInputTokens.

    1.0.5release notes

  • Tool call contents and tool call IDs are now included to improve token count approximation.

    1.0.5release notes

Tooling 1

  • Type inference is implemented for tool streams, allowing developers to infer their types.

    1.2.31release notes

Fixes and other changes 59

  • A failed tool call or subagent no longer crashes the process when its output promise is never consumed.

    1.6.6release notes

  • A Command returned from wrapModelCall is applied once when outer middleware passes it through.

    1.6.6release notes

  • Preserves model errors propagated through middleware.

    1.6.3release notes

  • The array form of retryOn now retries errors that are subclasses of a listed class, matching toolRetryMiddleware.

    1.6.3release notes

  • Approved, edited, and auto-approved tool calls are now executed when other calls in the same interrupt are rejected, instead of being dropped without a ToolMessage.

    1.6.1release notes

  • 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.

    1.5.18release notes

  • 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.

    1.5.16release notes

  • Preserves LangGraph interrupts instead of retrying them or converting them into tool errors, allowing interrupted tool calls to pause and resume through their checkpointer.

    1.5.15release notes

  • 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.

    1.5.14release notes

  • Callbacks are preserved when the compiled graph is extracted, without duplicate calls through the agent.

    1.5.12release notes

  • Structured-output parsing now ignores thought/reasoning text blocks.

    1.5.11release notes

  • The gateway now uses a unified endpoint.

    1.5.9release notes

  • Runtime instance comparisons now use the same logic as .isInstance(), avoiding conflicts when multiple versions of core are installed.

    1.5.6release notes

  • Resolves LocalFileStore keys with path.relative.

    1.5.5release notes

  • Malformed tool input schemas are unrecoverable.

    1.5.3release notes

  • Strict tools are decoupled from strict structured output responses.

    1.5.2release notes

  • Tool message outputs are unwrapped in agent streams.

    1.4.2release notes

  • ToolMessages produced by todoListMiddleware now have a name set.

    1.4.2release notes

  • Prevents llmToolSelectorMiddleware from leaking into the message stream.

    1.4.1release notes

  • Prevents local file corruption when using LocalFileStore.

    1.3.3release notes

  • createAgent and prebuilt middleware are now exported from the browser entry point, making them available to browser users.

    1.2.38release notes

  • Reverting the Zod import in utils.ts fixes interoperability between Zod v3 and v4.

    1.2.38release notes

  • Adds the aws alias so hub/node can auto-detect ChatBedrockConverse from Python-serialized prompts.

    1.2.37release notes

  • Structured output using providerStrategy is supported for Google Gemini models in createAgent.

    1.2.36release notes

  • Fixes routing when an agent combines returnDirect tools with beforeModel middleware, preventing non-returnDirect tools from failing with an unknown or null destination.

    1.2.33release notes

  • Serializable schemas are now exposed on the create agent response format.

    1.2.31release notes

  • The todo schema is now exported for developers to use.

    1.2.31release notes

  • Structured output retry Commands are now propagated through wrapModelCall middleware.

    1.2.29release notes

  • 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.

    1.2.28release notes

  • The middleware runtime now receives store from the LangGraph config; previously, runtime.store was always undefined even when a store was provided to createAgent().

    1.2.28release notes

  • Middleware hooks now infer StateSchema value types correctly.

    1.2.27release notes

  • The shared currentSystemMessage is reset when a middleware handler retries.

    1.2.26release notes

  • Export the ModelRequest interface so developers can import and use it.

    1.2.25release notes

  • Persist underscore-prefixed middleware state fields across graph steps.

    1.2.25release notes

  • Fixed streaming types.

    1.2.24release notes

  • Fixed structured output on opus.

    1.2.23release notes

  • Subagent names are now propagated in metadata.

    1.2.21release notes

  • Supports concurrent dynamic prompts in agentNode.

    1.2.20release notes

  • Pregel keys are filtered from the cache key to avoid out-of-memory errors.

    1.2.16release notes

  • StateSchema is now supported in the middleware pipeline.

    1.2.15release notesupgrade guide

  • Middleware state parsing now correctly handles both Zod objects and LangGraph's StateSchema.

    1.2.14release notes

  • Graph interrupt errors are now bubbled up as-is.

    1.2.12release notes

  • Middleware errors use cause instead of concatenating the error, preserving the underlying cause.

    1.2.10release notes

  • createAgent state schemas now preserve reducer metadata.

    1.2.8release notes

  • Models now make only one write_todo call at a time.

    1.2.7release notes

  • The afterModel Router now uses parseJumpToTarget.

    1.2.4release notes

  • Message summarization now uses getBufferString, changing how messages are converted to summary input.

    1.2.4release notes

  • Summarization now preserves tool call and AIMessage pairings.

    1.2.4release notes

  • The schema title is now passed through properly.

    1.2.4release notes

  • Interop with Zod is improved.

    1.2.4release notes

  • Prevents functions from being accidentally assignable to AgentMiddleware.

    1.1.6release notes

  • Fixes patch prompts created from runs.

    1.1.6release notes

  • Structured output is now properly retrieved from a thinking block.

    1.1.6release notes

  • Uses summaryPrefix or falls back to the default prefix.

    1.1.6release notes

  • Invoke responses are detected better in agent nodes.

    1.1.3release notes

  • State rendering in LangSmith studio was improved.

    1.1.3release notes

  • Detection of models with native support for structured output was fixed.

    1.1.3release notes

  • AgentNode error handling behaviour was updated.

    1.0.6release notes

  • The toolEmulator middleware was improved.

    1.0.5release notes

langchain 0.32 changes

Security 1

Fixes and other changes 1

  • Fixes the default temperature option for v0/anthropic.

    0.3.58release notes