Files
langgraphjs/libs/sdk-react
github-actions[bot] 73ecaa0fb5 chore: version packages (#2536)
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and the packages will
be published to npm automatically. If you're not ready to do a release
yet, that's fine, whenever you add more changesets to main, this PR will
be updated.


# Releases
## @langchain/langgraph-checkpoint@1.1.2

### Patch Changes

- [#2544](https://github.com/langchain-ai/langgraphjs/pull/2544)
[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): make concurrent DeltaChannel writes deterministic on
replay

Concurrent same-superstep writes to a `DeltaChannel` could reconstruct
from a
checkpoint differently than they were applied live, because live
execution
ordered them by task path while savers replayed them by task id. This
fixes that
    divergence in two complementary ways:

- Plain concurrent writes are now applied in the canonical `(task_id,
idx)`
order on both paths: `_applyWrites` orders them that way live, and the
`getDeltaChannelHistory` walk enforces the same order so reconstruction
matches live for every saver (Postgres, SQLite, MongoDB, Redis, and
custom).
- An `Overwrite` now wins its entire super-step: every sibling write in
the same
        step — before AND after the `Overwrite` — is discarded, matching
`BinaryOperatorAggregate`. This makes the result independent of the
(unstable)
ordering of concurrent fan-in writes; previously a plain write that
landed
        after an `Overwrite` in the same step was still folded in.

To keep reconstruction in sync with this `Overwrite` rule, any
`DeltaChannel`
that sees an `Overwrite` in a super-step is now force-snapshotted at the
next
checkpoint (and, under `"exit"` durability, in the final checkpoint).
The
post-overwrite value is materialized into `channel_values`, so a cold
read seeds
from that snapshot and never has to replay across the reset — making
live and
reconstructed state identical without changing the sparse-replay history
shape.
    These delta-channel APIs remain Beta.

- [#2531](https://github.com/langchain-ai/langgraphjs/pull/2531)
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): forward task metadata and name subagents via
lc_agent_name

`mapDebugTasks` now forwards filtered user-meaningful task config
metadata
(including `lc_agent_name`) onto `tasks` stream payloads. The lifecycle
    transformer uses that metadata to set subagent `graph_name` from
`lc_agent_name` and recover `cause: { type: "toolCall", tool_call_id }`
from parent tool-dispatch tasks. Adds the shared
`EXCLUDED_METADATA_KEYS`
    constant to `@langchain/langgraph-checkpoint`. Ports langgraph#7928.

## @langchain/langgraph-checkpoint-redis@1.0.10

### Patch Changes

- [#2336](https://github.com/langchain-ai/langgraphjs/pull/2336)
[`25907eb`](https://github.com/langchain-ai/langgraphjs/commit/25907eb0be25258c26327c6c68c72bc828ee1cff)
Thanks [@MohMaherId](https://github.com/MohMaherId)! -
fix(langgraph-checkpoint-redis): persist and reconstruct full
`channel_values` across multi-node graphs.

`RedisSaver.put()` delta-filters `channel_values` to only the channels
written by the current node, but `getTuple()` had no reconstruction
logic — unlike `PostgresSaver` — so any multi-node graph whose last node
wrote a subset of channels silently lost the others. Each changed
channel is now persisted as a version-keyed `checkpoint_blob:*` entry in
`put()` and missing channels are reconstructed from those blobs on read.

`deleteThread()` now also deletes the `checkpoint_blob:*` keys. Without
this the blobs introduced above would orphan forever (memory growth) and
thread deletion would be incomplete, matching
`PostgresSaver.deleteThread()` parity.

When `ttlConfig.refreshOnRead` is enabled, reads now refresh the TTL of
the reconstructed `checkpoint_blob:*` keys alongside the checkpoint key.
Otherwise a read would keep the checkpoint alive while the blobs it
depends on expired, silently dropping reconstructed channels.

On write, `put()` now refreshes the TTL of every blob the checkpoint
references (the full `channel_versions` set), not just the channels
changed by the current node, so carried-over blobs from earlier nodes
expire in lockstep with the checkpoint doc. This write-side refresh is
independent of `refreshOnRead`. The per-channel blob writes also now run
in parallel.

Known limitation: with TTL enabled, a carried-over blob can still be
lost if it expires during an idle gap longer than `defaultTTL` (no read
or write refreshed it in time). When that happens the channel is left
cleanly absent on read rather than erroring. Fully closing this gap
(re-persisting expired blobs) is tracked as a follow-up.

## @langchain/langgraph@1.4.3

### Patch Changes

- [#2544](https://github.com/langchain-ai/langgraphjs/pull/2544)
[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): make concurrent DeltaChannel writes deterministic on
replay

Concurrent same-superstep writes to a `DeltaChannel` could reconstruct
from a
checkpoint differently than they were applied live, because live
execution
ordered them by task path while savers replayed them by task id. This
fixes that
    divergence in two complementary ways:

- Plain concurrent writes are now applied in the canonical `(task_id,
idx)`
order on both paths: `_applyWrites` orders them that way live, and the
`getDeltaChannelHistory` walk enforces the same order so reconstruction
matches live for every saver (Postgres, SQLite, MongoDB, Redis, and
custom).
- An `Overwrite` now wins its entire super-step: every sibling write in
the same
        step — before AND after the `Overwrite` — is discarded, matching
`BinaryOperatorAggregate`. This makes the result independent of the
(unstable)
ordering of concurrent fan-in writes; previously a plain write that
landed
        after an `Overwrite` in the same step was still folded in.

To keep reconstruction in sync with this `Overwrite` rule, any
`DeltaChannel`
that sees an `Overwrite` in a super-step is now force-snapshotted at the
next
checkpoint (and, under `"exit"` durability, in the final checkpoint).
The
post-overwrite value is materialized into `channel_values`, so a cold
read seeds
from that snapshot and never has to replay across the reset — making
live and
reconstructed state identical without changing the sparse-replay history
shape.
    These delta-channel APIs remain Beta.

- [#2531](https://github.com/langchain-ai/langgraphjs/pull/2531)
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): merge instead of overwrite in `ensureLangGraphConfig`

`ensureLangGraphConfig` now per-key merges `callbacks`, `tags`,
`metadata`,
and `configurable` across configs instead of last-write-wins, so values
bound via `.withConfig({...})` survive when a later (e.g. invoke-time)
config supplies other keys. The merged dicts are fresh objects, fixing a
by-reference mutation of shared base configs. Also drops the
now-redundant
`combineCallbacks` workaround in `streamEvents`, which double-registered
and
    double-fired graph-bound callbacks.

- [#2531](https://github.com/langchain-ai/langgraphjs/pull/2531)
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): preserve namespace nesting for imperative graph invokes

When a compiled graph is invoked from inside another graph's running
task
(e.g. a tool body calling `subAgent.invoke(...)`), the surrounding task
context — including the langgraph-internal nesting keys
(`__pregel_read`,
`__pregel_stream`, `checkpoint_ns`, the checkpoint map) — is propagated
    implicitly via `AsyncLocalStorage`. The base `Runnable.stream` calls
langchain-core's `ensureConfig`, which replaces the ambient
`configurable`
wholesale whenever the caller passes its own. Because `createAgent`
always
supplies a `configurable`, every tool-invoked sub-agent lost those keys,
ran
as a fresh root run, and had its streamed events flattened to the root
    namespace instead of nesting under the triggering task.

`Pregel.stream` now merges the ambient `configurable` underneath the
caller's
    (caller keys win per-key) when the ambient marks an active task
(`__pregel_read` present) but the explicit `configurable` is missing it.
Declared subgraph nodes (which already carry their own `__pregel_read`)
and
    top-level runs are unaffected.

- [#2537](https://github.com/langchain-ai/langgraphjs/pull/2537)
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): dispatch stream messages handler inline

The v3 `messages` handler (`StreamProtocolMessagesHandler`, which powers
`run.messages`) only performs a synchronous `push()` onto the run's
stream, but
its callbacks were dispatched on LangChain's background callback queue
(the
default `awaitHandlers === false`). A model or tool call inside a nested
or
parallel task could therefore flush its `messages` chunk _after_ the
Pregel
loop returned and sealed the stream, where
`IterableReadableWritableStream.push`
silently drops chunks once closed. This surfaced as empty per-message
streams
(`sub.messages`) for subagents dispatched in parallel from a single
tools step.

The handler now sets `awaitHandlers = true` so its callbacks run inline
— every
push happens during the originating model/chain call while the stream is
still
open. This avoids the global over-wait, fake-timer deadlock, and
error-path
unhandled rejections that a blanket `awaitAllCallbacks()` drain before
close
    would have introduced.

- [#2531](https://github.com/langchain-ai/langgraphjs/pull/2531)
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): forward task metadata and name subagents via
lc_agent_name

`mapDebugTasks` now forwards filtered user-meaningful task config
metadata
(including `lc_agent_name`) onto `tasks` stream payloads. The lifecycle
    transformer uses that metadata to set subagent `graph_name` from
`lc_agent_name` and recover `cause: { type: "toolCall", tool_call_id }`
from parent tool-dispatch tasks. Adds the shared
`EXCLUDED_METADATA_KEYS`
    constant to `@langchain/langgraph-checkpoint`. Ports langgraph#7928.

- [#2549](https://github.com/langchain-ai/langgraphjs/pull/2549)
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(langgraph): support DeltaChannel fields in StateSchema

Add a `DeltaValue` state field (and a `MessagesDeltaValue` prebuilt) so
a
`DeltaChannel` can be declared via `StateSchema`, not just
`Annotation.Root` or
a raw channel map. `StateSchema` now maps `DeltaValue` to a
`DeltaChannel`
(forwarding `snapshotFrequency` and the value-schema default) and
validates its
    inputs/`Overwrite` updates like `ReducedValue`.

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b)]:
    -   @langchain/langgraph-checkpoint@1.1.2
    -   @langchain/langgraph-sdk@1.9.23

## @langchain/langgraph-sdk@1.9.23

### Patch Changes

- [#2545](https://github.com/langchain-ai/langgraphjs/pull/2545)
[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236)
Thanks [@christian-bromann](https://github.com/christian-bromann)! -
fix(sdk): avoid scoped stream resubscribe churn

Defer final projection disposal by one microtask so framework bindings
that release and immediately reacquire the same scoped projection during
reactive updates keep the existing stream subscription instead of
rotating through root-only and scoped SSE filters.

## @langchain/angular@1.0.24

### Patch Changes

- Updated dependencies
\[[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236)]:
    -   @langchain/langgraph-sdk@1.9.23

## @langchain/react@1.0.24

### Patch Changes

- Updated dependencies
\[[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236)]:
    -   @langchain/langgraph-sdk@1.9.23

## @langchain/svelte@1.0.24

### Patch Changes

- Updated dependencies
\[[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236)]:
    -   @langchain/langgraph-sdk@1.9.23

## @langchain/vue@1.0.24

### Patch Changes

- Updated dependencies
\[[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236)]:
    -   @langchain/langgraph-sdk@1.9.23

## @example/ai-elements@0.1.39

### Patch Changes

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)]:
    -   @langchain/langgraph@1.4.3
    -   @langchain/react@1.0.24

## @examples/assistant-ui-claude@0.1.39

### Patch Changes

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)]:
    -   @langchain/langgraph@1.4.3
    -   @langchain/react@1.0.24

## @examples/ui-angular@0.0.49

### Patch Changes

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236),
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)]:
    -   @langchain/langgraph@1.4.3
    -   @langchain/langgraph-sdk@1.9.23
    -   @langchain/angular@1.0.24

## @examples/ui-multimodal@0.0.25

### Patch Changes

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)]:
    -   @langchain/langgraph@1.4.3
    -   @langchain/react@1.0.24

## @examples/ui-react@0.0.25

### Patch Changes

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`2134c8a`](https://github.com/langchain-ai/langgraphjs/commit/2134c8a2c0bc8dd2ebea33e1191c8dd0c4b83236),
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)]:
    -   @langchain/langgraph@1.4.3
    -   @langchain/langgraph-sdk@1.9.23
    -   @langchain/react@1.0.24

## langgraph@1.0.43

### Patch Changes

- Updated dependencies
\[[`4487214`](https://github.com/langchain-ai/langgraphjs/commit/448721449f0801009ba76b03dd2e9c16f900bbba),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`be09666`](https://github.com/langchain-ai/langgraphjs/commit/be096663f42fe7ea9355d6c0def4854e657866d8),
[`38cfe01`](https://github.com/langchain-ai/langgraphjs/commit/38cfe01ff02490ff6bcc86c66708ef671f2e0d4b),
[`bc667a9`](https://github.com/langchain-ai/langgraphjs/commit/bc667a998ae9909d15795387dad45048e8947219)]:
    -   @langchain/langgraph@1.4.3

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
2026-06-17 15:34:21 -07:00
..
2026-06-17 15:34:21 -07:00
2026-06-17 15:34:21 -07:00

@langchain/react

React SDK for building AI-powered applications with Deep Agents, LangChain and LangGraph.

@langchain/react v1 ships a v2-native useStream hook together with a small family of companion selector hooks. The root hook gives you always-on access to thread state, messages, tool calls, and interrupts; the selector hooks open ref-counted subscriptions for the things that aren't needed on every view (per-subagent messages, media streams, submission queue, message metadata, raw channels, …).

Highlights

  • v2-native streaming protocol. Session-based transport with automatic re-attach on remount; no more reconnectOnMount / joinStream dance.
  • Selector-based subscriptions. Namespaced data (subagents, subgraphs, media) streams only when a component actually mounts the matching selector hook, and releases on unmount.
  • Always-on root projections. values, messages, toolCalls, and interrupts are live at the root with zero per-subscription cost.
  • Agent-brand type inference. useStream<typeof agent>() unwraps state, tool calls, and subagent state maps from an agent brand.
  • Discriminated options. The hosted Agent Server path and the custom-adapter path are two arms of a single typed union — mixing them is a compile-time error.
  • Multimodal media streams. Built-in assembly for audio, images, video, and files.
  • Suspense integration. useSuspenseStream hands the initial hydration phase to <Suspense> and non-streaming errors to Error Boundaries.

Installation

npm install @langchain/react @langchain/core

Peer dependencies: react (^18 || ^19), @langchain/core (^1.1.27).

Quick Start

import { useStream } from "@langchain/react";

function Chat() {
  const { messages, submit, isLoading } = useStream({
    assistantId: "agent",
    apiUrl: "http://localhost:2024",
  });

  return (
    <div>
      {messages.map((msg, i) => (
        <div key={msg.id ?? i}>{String(msg.content)}</div>
      ))}

      <button
        disabled={isLoading}
        onClick={() =>
          void submit({
            messages: [{ type: "human", content: "Hello!" }],
          })
        }
      >
        Send
      </button>
    </div>
  );
}

Mental model

@langchain/react v1 splits the surface into two layers:

  1. Root hook (useStream). Owns the thread lifecycle, the transport, and a handful of always-on projections (values, messages, toolCalls, interrupts, error, isLoading, discovery maps). Mount it once per thread.
  2. Companion selector hooks. Each one opens a ref-counted subscription when the first component mounts it and releases it when the last consumer unmounts. Use them for anything scoped to a namespace, a subagent / subgraph, a specific message, a specific extension channel, or a media stream.
import {
  useStream,
  useMessages,
  useToolCalls,
  useSubmissionQueue,
} from "@langchain/react";

function Chat() {
  const stream = useStream({ assistantId: "agent", apiUrl: "/api" });

  // Root: free reads, no new subscription.
  const messages = useMessages(stream); // same as stream.messages

  // Scoped: opens a namespaced subscription on mount.
  const queue = useSubmissionQueue(stream);
}

Documentation

Detailed guides live in ./docs. Start with the two files most apps need first:

  • useStream — options, return shape, submit(), stop(), respond(), hydrationPromise.
  • Companion selector hooksuseValues, useMessages, useToolCalls, useMessageMetadata, useChannel, useExtension, and friends.

Feature-specific guides:

Migrating from v0 to v1

The useStream import name is unchanged, but the return shape, option bag, and protocol semantics all shifted. Most chat apps migrate in well under an hour — the full migration guide with line-by-line diffs lives in ./docs/v1-migration.md.

Legacy type aliases (UseStream, UseSuspenseStream, UseStreamOptions, UseStreamTransport, QueueEntry, GetToolCallsType, SubagentStream, …) and the legacy FetchStreamTransport class are no longer re-exported from @langchain/react. Apps still on the legacy surface can import directly from @langchain/langgraph-sdk/ui during their migration.

Playground

For complete end-to-end examples with full agentic UIs, visit the LangChain UI Playground.

License

MIT