unstale

npm / @langchain/core

@langchain/core

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

11 breaking8 security1 deprecations61 new APIs and options2 performance18 behavior and defaults2 tooling75 fixes and other

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

npx @unstale/cli init

@unstale/cli on npm

@langchain/core 1149 changes

Breaking changes 11

  • Types invoke answers from the questions asked, including Choice labels, and rejects unanswered questions or responses with the wrong type or label.

    1.4.0release notes

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

    1.4.0release notes

  • JSON, tool-call, and structured output parsers throw ModelRefusalError from @langchain/core/errors when the model refuses, instead of a generic parsing error.

    1.3.7release notes

  • Tool-call args stream as delta slices instead of snapshots; raw-event consumers and stream transformers should read tool-call-delta. Tool-call id, name and index move to content-block-start, with late id or name on content-block-finish.

    1.3.0release notes

  • Retry middleware respects retryability marks by default and stops retrying non-retryable errors; unclassified errors keep retrying as before.

    1.2.8release notes

  • Passing retryOn: () => true restores the old retry behavior.

    1.2.8release notes

  • Arrays are treated as message content blocks only when every element is an object with a type; other arrays are JSON-stringified.

    1.2.1release notes

  • Reverts adding all chat model and LLM invocation parameters to metadata.

    1.1.37release notes

  • fakeModel has moved from utils/testing to the testing namespace.

    1.1.31release notes

  • Adds createNamespace and the Namespace API for hierarchical symbol-based branding, enabling reliable cross-realm identity for class hierarchies.

    1.1.25release notes

  • When aborted during streaming with streaming callback handlers, invoke throws ModelAbortError with accumulated partialOutput.

    1.1.18release notes

Security 8

  • Recursion depth guards for mustache parsing and dict prompt traversal prevent stack-exhaustion DoS from deeply nested attacker-controlled templates.

    1.3.5release notes

  • LangChain: MongoDBChatMessageHistory query injection can allow cross-session access

    1.3.1security advisory

  • Adds utilities for validating URLs against private IPs, cloud metadata endpoints, and localhost.

    1.1.21release notes

  • Hardens URL loading against SSRF attacks by validating safe URLs and comparing origins.

    1.1.21release notes

  • LangChain serialization injection vulnerability enables secret extraction

    1.1.8security advisory

  • Security hardening was added for load.

    1.1.8release notes

  • Various security fixes were made in community/core.

    1.1.5release notes

  • LangChain: RediSearch Filter Injection via Unescaped Tag/Text Values

    1.1.1security advisory

Deprecations 1

  • Deprecated in favor of LangChainError subclasses.

    1.1.25release notes

New APIs and options 32

  • Adds a decisions entry point with BaseDecisionModel, question and answer types, and parsing utilities for providers.

    1.4.0release notes

  • Adds a classifier-response parsing utility for providers.

    1.4.0release notes

  • Adds a question-parsing utility for providers.

    1.4.0release notes

  • Exports omitPayload from @langchain/core/tracers/tracer_langchain; it is a TracePolicy processor that records an empty payload while keeping the run.

    1.3.4release notes

  • Adds tracePolicy to shape the inputs and outputs LangChainTracer sends to LangSmith for the sequence's own run.

    1.3.3release notes

  • Adds a way to mark messages the agent harness adds.

    1.3.2release notes

  • Adds a way to retrieve metadata marking messages the agent harness adds.

    1.3.2release notes

  • Adds a type for metadata marking messages the agent harness adds.

    1.3.2release notes

  • Adds a ModelProfile field indicating whether a chat model sends a system message after the first turn in place.

    1.2.20release notes

  • Adds a ModelProfile field indicating whether a chat model can add a tool through a message rather than the request's tool list.

    1.2.20release notes

  • Adds explicit agent address support, inherits project and address destinations together, and delegates default destination resolution to the LangSmith SDK.

    1.2.18release notes

  • Exposes a branded class type for provider declarations, making the type available to provider authors.

    1.2.16release notes

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

    1.2.14release notes

  • Adds an exported function that reads an error's retryability mark and returns undefined when nobody classified it.

    1.2.8release notes

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

    1.2.8release notes

  • Adds an exported function to mark an error as retryable or non-retryable without changing its class or shape.

    1.2.8release notes

  • OpenAI, Anthropic, and Fireworks chat models now support LangSmith Gateway environment configuration.

    1.2.5release notes

  • Adds conversion of stream events to an OpenAI-compatible format.

    1.2.0release notes

  • OpenRouter reasoning content is surfaced as standard reasoning content blocks alongside text and tool calls.

    1.1.48release notes

  • UUID utilities now export v6 generation support, including the upstream v1ToV6 helper.

    1.1.47release notes

  • Adds support for browser tools.

    1.1.39release notes

  • FakeBuiltModel is now exported for use with the fakeModel builder API.

    1.1.32release notes

  • Type inference is implemented for tool streams, allowing developers to infer types from streamed tool calls.

    1.1.32release notes

  • Adds standard schema support for structured output.

    1.1.30release notes

  • Runnable traces now include package version metadata in this.metadata.versions, making version information available in LangSmith trace metadata.

    1.1.29release notes

  • Tool calling supports asynchronous generators for streaming partial tool results.

    1.1.28release notes

  • Adds ContextOverflowError, raised for context overflow in Anthropic and OpenAI; includes a fromError() static factory method.

    1.1.25release notes

  • Adds a static factory method for creating a ContextOverflowError from an error.

    1.1.25release notes

  • Adds a base class that all LangChain errors extend.

    1.1.25release notes

  • Added an error class in @langchain/core/errors that contains partial output when a model invocation is aborted mid-stream.

    1.1.18release notes

  • FakeListChatModel now supports bindTools.

    1.1.5release notes

  • Adds extras to tools.

    1.1.1release notes

Performance 2

  • Tool call chunks are collapsed lazily on first read of tool_calls or invalid_tool_calls, avoiding repeated parsing during streamed delta concatenation.

    1.2.18release notes

  • Caches Zod-to-JSON-Schema conversions in toJsonSchema(), avoiding repeated conversions.

    1.1.37release notes

Behavior and default changes 18

  • addNotificationMetadata now accepts tool messages.

    1.4.2release notes

  • Tool messages created for reject and respond decisions now include lc_source: "hitl_interrupt_decision" and lc_data: { decision }.

    1.4.2release notes

  • A standard refusal content block is added to message.contentBlocks for model refusals from OpenAI, Anthropic, and Gemini.

    1.3.7release notes

  • Long tool-call IDs are abbreviated when chat messages are formatted as strings, while the original messages remain unchanged.

    1.2.13release notes

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

    1.2.11release notes

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

    1.2.8release notes

  • Retry middleware respects retryability marks by default and stops retrying non-retryable errors; unclassified errors keep retrying as before.

    1.2.8release notes

  • Traced metadata now includes chat model and LLM invocation parameters.

    1.1.41release notes

  • Tracer-scoped inheritable metadata and tag options are separated from runnable metadata; ensureConfig metadata mirroring is limited to model.

    1.1.40release notes

  • Adds LangSmith integration metadata to createAgent.

    1.1.35release notes

  • Adds LangSmith integration metadata to initChatModel.

    1.1.35release notes

  • All invocation parameters are included as part of metadata.

    1.1.34release notes

  • OpenAI image generation outputs are represented as proper image content blocks.

    1.1.16release notes

  • Tool call content returns compacted JSON.

    1.1.16release notes

  • Adds literal name type inference to tool(), improving type inference for tool names.

    1.1.12release notes

  • Run IDs are now generated with UUIDv7 instead of UUIDv4.

    1.1.5release notesrelease notes

  • Starting in version 1.1.4, the default recursion limit is 10,007 steps.

    1.1.4docs

  • Parsing now allows more partial JSON, which can affect how developers handle incomplete JSON output.

    1.1.2release notes

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.

    1.1.35release notes

  • Adds custom Vitest matchers for LangChain message and tool call assertions, registerable with expect.extend(langchainMatchers).

    1.1.31release notes

Fixes and other changes 75

  • Streamed input_json_delta blocks are merged into the preceding tool_use or server_tool_use block at the same index.

    1.4.1release notes

  • Prevents v2 from hanging or leaking an unhandled rejection when aborted, and from throwing its own AbortError when the consumer breaks early.

    1.3.6release notes

  • The tool run now ends when its signal is already aborted.

    1.3.5release notes

  • When processInputs or processOutputs throws, LangChainTracer still sends and ends the run, dropping that payload and setting the error instead of skipping the run or leaving it pending in LangSmith.

    1.3.4release notes

  • Batched sequence runs now each record their own output.

    1.3.3release notes

  • Merged runnable configs now keep each callback handler once and in order, preventing duplicate callback delivery.

    1.3.1release notes

  • drawMermaid escapes node metadata labels and omits object values so metadata with brackets or objects no longer breaks Mermaid parsing.

    1.3.1release notes

  • Graph.toJSON output now includes node metadata when set, matching Python.

    1.3.1release notes

  • ChatModelStream appends tool-call-delta slices to a tool call's args, while block-delta continues to replace them.

    1.2.19release notes

  • ChatModelStream ignores unrecognized delta types instead of throwing an error.

    1.2.19release notes

  • Runtime context is preserved in ambient runnable config across tool calls, nested runnables, and streaming.

    1.2.17release notes

  • Structured tool arguments are preserved in tracer run inputs.

    1.2.12release notes

  • OpenAI Responses API replay in v1 preserves every reasoning item's id and encrypted_content in original order under Zero Data Retention.

    1.2.11release notes

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

    1.2.11release notes

  • BaseMessage.text now uses contentBlocks.

    1.2.10release notes

  • ChatVertexAI and ChatGoogle contentBlocks now include tool_call blocks from message.tool_calls and skip spurious empty text blocks.

    1.2.9release notes

  • The gateway now uses a unified endpoint.

    1.2.8release notes

  • Peer dependencies were updated for core and langchain, which may affect package compatibility.

    1.2.7release notes

  • Overrides Symbol.hasInstance to use the same logic as .isInstance() for comparable properties, avoiding conflicts when multiple versions of core are installed.

    1.2.6release notes

  • The mustache escape override is now passed per render call.

    1.2.5release notes

  • Nested tracer callbacks that share run bookkeeping are coalesced.

    1.2.4release notes

  • Binds splitText when trimMessages receives a TextSplitter instance.

    1.2.4release notes

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

    1.2.3release notes

  • Coerces string content to text blocks when constructing an AIMessage with v1 output metadata, preventing contentBlocks.push errors.

    1.2.2release notes

  • Provider 429 errors are classified before retrying.

    1.2.1release notes

  • Preserves existing v1 contentBlocks when constructing AIMessage instances, preventing serialized messages from losing block content during deserialization.

    1.2.0release notes

  • CommonJS default re-exports are now callable.

    1.1.48release notes

  • Apply v1 message casting after implicit streaming aggregation.

    1.1.47release notes

  • Different content block types are kept separate when merging chunks.

    1.1.46release notes

  • Inheritance behavior for special keys in tracer metadata was updated.

    1.1.41release notes

  • createAgent now accepts cross-version runnable models.

    1.1.38release notes

  • Normalizes single-block content when merging content.

    1.1.37release notes

  • Surfaces Responses API message phase on text content blocks and supports round-tripping it through standard content paths.

    1.1.37release notes

  • Chained concat() calls no longer spread lc_kwargs into the new constructor, preventing nested duplication of system message content.

    1.1.36release notes

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

    1.1.36release notes

  • Preserves multimodal content as placeholders.

    1.1.33release notes

  • The timeout option is now respected in streamEvents v2.

    1.1.33release notes

  • Preserves thoughtSignature in array content when streaming with thinking models.

    1.1.32release notes

  • Empty string tool call chunk IDs are treated like null or undefined during merging, allowing old completions-style streaming chunks to merge by index.

    1.1.32release notes

  • An explicit symbol type annotation prevents TypeScript from inferring unique symbol, avoiding incompatibility when multiple package versions are present in a dependency tree.

    1.1.30release notes

  • Uses Symbol.for() and an explicit symbol type annotation for cross-realm compatibility and compatibility when multiple package versions are present.

    1.1.30release notes

  • Standard schema type guards now support callable schemas.

    1.1.30release notes

  • Added usage_metadata to AIMessage lc_aliases.

    1.1.29release notes

  • Content blocks are merged by string index during streaming.

    1.1.28release notes

  • Tool calls are now preserved when concatenating AIMessageChunks.

    1.1.26release notes

  • Supports reasoning/thinking blocks in parsed string output.

    1.1.25release notes

  • Fixes contentBlocks for file_search_call in the OpenAI Responses API.

    1.1.24release notes

  • Fixes contentBlocks for web_search_call in the OpenAI Responses API.

    1.1.24release notes

  • Empty text blocks are skipped in ChatOpenAI contentBlocks.

    1.1.22release notes

  • Avoids long-lived abort signals.

    1.1.19release notes

  • Provider implementations now check and propagate abort signals in both _generate() and _streamResponseChunks().

    1.1.18release notes

  • Updated invoke, stream, generate, and generatePrompt signatures across Runnable, BaseChatModel, and BaseLLM to accept partial call options without TypeScript errors.

    1.1.18release notes

  • When aborted, stream throws a regular AbortError because chunks have already been yielded to the caller.

    1.1.18release notes

  • Reads error.status when response.status is absent, avoiding retries for OpenAI SDK 4xx errors.

    1.1.16release notes

  • When tracingEnabled is false, inherited LangChainTracer handlers are stripped so child runs do not produce traces.

    1.1.16release notesrelease notes

  • Fixes additional undefined and null errors.

    1.1.16release notes

  • Preserves index and timestamp fields when merging dictionaries.

    1.1.15release notes

  • JsonOutputParser now sources content from the text accessor.

    1.1.13release notes

  • Reasoning tokens are now properly elevated.

    1.1.13release notes

  • Serialization now allows shared object references.

    1.1.11release notes

  • Fixes an error when merging undefined values.

    1.1.10release notes

  • load now handles circular references.

    1.1.9release notes

  • Numeric values are now handled correctly by mergeDicts.

    1.1.9release notes

  • Message summarization now uses getBufferString.

    1.1.9release notes

  • Interop with Zod has been improved.

    1.1.9release notes

  • Ensures streaming test chat models respect AbortSignal.

    1.1.6release notes

  • Avoids writing to TransformStream when the underlying ReadableStream is closed.

    1.1.6release notes

  • Fixes an error when merging two undefined objects.

    1.1.6release notes

  • Graph Mermaid output handles subgraph nesting better.

    1.1.5release notes

  • The tracer handles missing parent runs to prevent LangSmith 400 errors.

    1.1.5release notes

  • MCP tool calls now preserve the timeout from RunnableConfig.

    1.1.5release notes

  • Nested objects in tool call arguments are now displayed properly instead of as [object Object].

    1.1.5release notes

  • Uses toBase64Url instead of btoa for encoding Mermaid images.

    1.1.3release notes

  • Fixes tool chunk concatenation behavior.

    1.1.3release notes

  • Uses a dynamic import for p-retry to support CommonJS environments.

    1.1.1release notes

@langchain/core 0.129 changes

New APIs and options 29

  • A POST endpoint creates custom workspace model prices, with matching and token-cost fields for pricing LLM runs ingested after the entry takes effect.

    0.1.0docs

  • Adds an endpoint to retrieve a model price entry the workspace uses to compute run costs, including custom, organization, and LangSmith default entries.

    0.1.0docs

  • Adds an API endpoint to create an organization model price entry that applies across every workspace in the organization.

    0.1.0docs

  • Adds a DELETE endpoint to delete an organization model price, whether or not it exists.

    0.1.0docs

  • Adds an endpoint to list model prices set for the organization, with page_size and cursor query parameters for pagination.

    0.1.0docs

  • Adds an endpoint to retrieve one team in an organization, with organization- or workspace-scoped read permissions.

    0.1.0docs

  • Adds an endpoint to list a team's access policies, with pagination and organization- or workspace-scoped read permissions.

    0.1.0docs

  • Adds an endpoint to detach an access policy from a team. For organization-wide teams, workspace_id selects the workspace; omitting it detaches the policy from every workspace the team can access.

    0.1.0docs

  • Adds a paginated endpoint for listing the workspace identities of a workspace-scoped team's members.

    0.1.0docs

  • A POST endpoint grants an organization-wide team a role in a workspace, creating a workspace-scoped team and recording eligible members’ workspace identities.

    0.1.0docs

  • Adds an endpoint to get one user group in the organization, with organization- or workspace-scoped read permissions.

    0.1.0docs

  • Adds an endpoint to attach an existing organization access policy to a user group, optionally limiting an organization-wide group's policy to one workspace.

    0.1.0docs

  • Adds an endpoint to list a user group's access policies, with pagination and scope-specific read permissions.

    0.1.0docs

  • Adds an endpoint to list members of a user group, with organization- or workspace-scoped read permissions.

    0.1.0docs

  • Accepts a cursor from the previous page to resume listing; an unissued cursor starts again at the first page.

    0.1.0docs

  • Accepts a page_size query parameter for the number of members per page, defaulting to 20 and limited to 1–100.

    0.1.0docs

  • Adds an endpoint to grant an organization-wide user group a role in a workspace.

    0.1.0docs

  • Adds a GET endpoint that resolves an AGENT, EXPERIMENT, or EVALUATOR address to a tracing project session ID.

    0.1.0docs

  • Adds a query parameter for pagination using an opaque cursor from a prior response's next_cursor.

    0.1.0docs

  • Adds a query parameter to filter results by a name substring.

    0.1.0docs

  • Adds a query parameter for the number of results per page, defaulting to 20.

    0.1.0docs

  • Adds an endpoint to create a copy-on-write copy of an existing volume. The source volume cannot be attached read-write to a sandbox that is not stopped.

    0.1.0docs

  • Adds the upsert query parameter to update an existing session with the same name.

    0.1.0docs

  • The root health check accepts an optional query parameter to check database connectivity.

    0.1.0docs

  • Removes an organization-wide user group's grant in a workspace, detaches its workspace access policies, and deletes its workspace-scoped user group there. Requires organization:user-groups:manage-grants.

    0.1.0docs

  • Adds an endpoint to list organization user groups, with optional workspace, parent group, identity, page size, and cursor filters.

    0.1.0docs

  • The query parameter requests run statistics when retrieving a tracing project or experiment; it defaults to false.

    0.1.0docs

  • Adds an endpoint to replace an organization model price using the full entry; omitted optional fields reset to defaults, and recorded costs on existing runs are not recomputed.

    0.1.0docs

  • Defines the response schema for a user group, including its identifiers, name, description, synchronization state, and timestamps.

    0.1.0docs