npm / @langchain/core
@langchain/core
What changed in @langchain/core 1, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-17.
7 breaking6 security1 deprecations22 new APIs and options2 performance14 behavior and defaults2 tooling65 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@langchain/core 1119 changes
Breaking changes 7
Retry middleware respects retryability marks by default and stops retrying non-retryable errors; unclassified errors keep retrying as before.
Passing retryOn: () => true restores the old retry behavior.
Arrays are treated as message content blocks only when every element is an object with a type; other arrays are JSON-stringified.
Reverts adding all chat model and LLM invocation parameters to metadata.
fakeModel has moved from utils/testing to the testing namespace.
Adds createNamespace and the Namespace API for hierarchical symbol-based branding, enabling reliable cross-realm identity for class hierarchies.
When aborted during streaming with streaming callback handlers, invoke throws ModelAbortError with accumulated partialOutput.
Security 6
Adds utilities for validating URLs against private IPs, cloud metadata endpoints, and localhost.
Hardens URL loading against SSRF attacks by validating safe URLs and comparing origins.
LangChain serialization injection vulnerability enables secret extraction
Security hardening was added for load.
Various security fixes were made in community/core.
LangChain: RediSearch Filter Injection via Unescaped Tag/Text Values
Deprecations 1
Deprecated in favor of LangChainError subclasses.
New APIs and options 22
Adds explicit agent address support, inherits project and address destinations together, and delegates default destination resolution to the LangSmith SDK.
Exposes a branded class type for provider declarations, making the type available to provider authors.
ModelProfile now includes fileMimeTypes so models can advertise accepted MIME types for generic file inputs; OpenAI Responses API models report the types supported by input_file, while Chat Completions profiles are unchanged.
Adds an exported function that reads an error's retryability mark and returns undefined when nobody classified it.
Models accept a per-call maxRetries value so a surrounding retry loop can take over.
Adds an exported function to mark an error as retryable or non-retryable without changing its class or shape.
OpenAI, Anthropic, and Fireworks chat models now support LangSmith Gateway environment configuration.
Adds conversion of stream events to an OpenAI-compatible format.
OpenRouter reasoning content is surfaced as standard reasoning content blocks alongside text and tool calls.
UUID utilities now export v6 generation support, including the upstream v1ToV6 helper.
Adds support for browser tools.
FakeBuiltModel is now exported for use with the fakeModel builder API.
Type inference is implemented for tool streams, allowing developers to infer types from streamed tool calls.
Adds standard schema support for structured output.
Runnable traces now include package version metadata in this.metadata.versions, making version information available in LangSmith trace metadata.
Tool calling supports asynchronous generators for streaming partial tool results.
Adds ContextOverflowError, raised for context overflow in Anthropic and OpenAI; includes a fromError() static factory method.
Adds a static factory method for creating a ContextOverflowError from an error.
Adds a base class that all LangChain errors extend.
Added an error class in @langchain/core/errors that contains partial output when a model invocation is aborted mid-stream.
FakeListChatModel now supports bindTools.
Adds extras to tools.
Performance 2
Tool call chunks are collapsed lazily on first read of
tool_callsorinvalid_tool_calls, avoiding repeated parsing during streamed delta concatenation.Caches Zod-to-JSON-Schema conversions in toJsonSchema(), avoiding repeated conversions.
Behavior and default changes 14
Long tool-call IDs are abbreviated when chat messages are formatted as strings, while the original messages remain unchanged.
The v0 default replay path reuses response_metadata.output directly, preserving every reasoning item's id and encrypted_content in original order under Zero Data Retention.
A custom handler replaces the built-in handler and opts out of automatic retryability marking.
Retry middleware respects retryability marks by default and stops retrying non-retryable errors; unclassified errors keep retrying as before.
Traced metadata now includes chat model and LLM invocation parameters.
Tracer-scoped inheritable metadata and tag options are separated from runnable metadata; ensureConfig metadata mirroring is limited to model.
Adds LangSmith integration metadata to createAgent.
Adds LangSmith integration metadata to initChatModel.
All invocation parameters are included as part of metadata.
OpenAI image generation outputs are represented as proper image content blocks.
Tool call content returns compacted JSON.
Adds literal name type inference to tool(), improving type inference for tool names.
Run IDs are now generated with UUIDv7 instead of UUIDv4.
Parsing now allows more partial JSON, which can affect how developers handle incomplete JSON output.
Tooling 2
Exported Zod type references in the public API are replaced with minimal structural interfaces to prevent TypeScript OOMs and unresponsive language servers in monorepo setups.
Adds custom Vitest matchers for LangChain message and tool call assertions, registerable with expect.extend(langchainMatchers).
Fixes and other changes 65
Runtime context is preserved in ambient runnable config across tool calls, nested runnables, and streaming.
Structured tool arguments are preserved in tracer run inputs.
OpenAI Responses API replay in v1 preserves every reasoning item's id and encrypted_content in original order under Zero Data Retention.
Streaming token usage is built from fully accumulated chunk metadata instead of being overwritten by the last chunk; this also populates llmOutput for @langchain/google invoke({streaming: true}).
BaseMessage.text now uses contentBlocks.
ChatVertexAI and ChatGoogle contentBlocks now include tool_call blocks from message.tool_calls and skip spurious empty text blocks.
The gateway now uses a unified endpoint.
Peer dependencies were updated for core and langchain, which may affect package compatibility.
Overrides Symbol.hasInstance to use the same logic as .isInstance() for comparable properties, avoiding conflicts when multiple versions of core are installed.
The mustache escape override is now passed per render call.
Nested tracer callbacks that share run bookkeeping are coalesced.
Binds splitText when trimMessages receives a TextSplitter instance.
Reasoning blocks are emitted in standard form with preserved signatures; incomplete signature-only reasoning is omitted during replay, while legacy and redacted reasoning remain compatible.
Coerces string content to text blocks when constructing an AIMessage with v1 output metadata, preventing contentBlocks.push errors.
Provider 429 errors are classified before retrying.
Preserves existing v1 contentBlocks when constructing AIMessage instances, preventing serialized messages from losing block content during deserialization.
CommonJS default re-exports are now callable.
Apply v1 message casting after implicit streaming aggregation.
Different content block types are kept separate when merging chunks.
Inheritance behavior for special keys in tracer metadata was updated.
createAgent now accepts cross-version runnable models.
Normalizes single-block content when merging content.
Surfaces Responses API message phase on text content blocks and supports round-tripping it through standard content paths.
Chained concat() calls no longer spread lc_kwargs into the new constructor, preventing nested duplication of system message content.
Streaming tool call deltas without an index now merge by id, preventing them from accumulating as separate entries in tool_call_chunks and additional_kwargs.tool_calls.
Preserves multimodal content as placeholders.
The timeout option is now respected in streamEvents v2.
Preserves thoughtSignature in array content when streaming with thinking models.
Empty string tool call chunk IDs are treated like null or undefined during merging, allowing old completions-style streaming chunks to merge by index.
An explicit symbol type annotation prevents TypeScript from inferring unique symbol, avoiding incompatibility when multiple package versions are present in a dependency tree.
Uses Symbol.for() and an explicit symbol type annotation for cross-realm compatibility and compatibility when multiple package versions are present.
Standard schema type guards now support callable schemas.
Added usage_metadata to AIMessage lc_aliases.
Content blocks are merged by string index during streaming.
Tool calls are now preserved when concatenating AIMessageChunks.
Supports reasoning/thinking blocks in parsed string output.
Fixes contentBlocks for file_search_call in the OpenAI Responses API.
Fixes contentBlocks for web_search_call in the OpenAI Responses API.
Empty text blocks are skipped in ChatOpenAI contentBlocks.
Avoids long-lived abort signals.
Provider implementations now check and propagate abort signals in both _generate() and _streamResponseChunks().
Updated invoke, stream, generate, and generatePrompt signatures across Runnable, BaseChatModel, and BaseLLM to accept partial call options without TypeScript errors.
When aborted, stream throws a regular AbortError because chunks have already been yielded to the caller.
Reads error.status when response.status is absent, avoiding retries for OpenAI SDK 4xx errors.
When tracingEnabled is false, inherited LangChainTracer handlers are stripped so child runs do not produce traces.
Fixes additional undefined and null errors.
Preserves index and timestamp fields when merging dictionaries.
JsonOutputParser now sources content from the text accessor.
Reasoning tokens are now properly elevated.
Serialization now allows shared object references.
Fixes an error when merging undefined values.
load now handles circular references.
Numeric values are now handled correctly by mergeDicts.
Message summarization now uses getBufferString.
Interop with Zod has been improved.
Ensures streaming test chat models respect AbortSignal.
Avoids writing to TransformStream when the underlying ReadableStream is closed.
Fixes an error when merging two undefined objects.
Graph Mermaid output handles subgraph nesting better.
The tracer handles missing parent runs to prevent LangSmith 400 errors.
MCP tool calls now preserve the timeout from RunnableConfig.
Nested objects in tool call arguments are now displayed properly instead of as [object Object].
Uses toBase64Url instead of btoa for encoding Mermaid images.
Fixes tool chunk concatenation behavior.
Uses a dynamic import for p-retry to support CommonJS environments.