Packages

@langchain/langgraph-sdk

1.17.0 · 17 Nov 2026MIT5.6M / weekRepositoryHomepagenpmAtom feed

Your version

1.16.0

12 Nov 2026Where it was published

1.17.0 is the newest release of 1.x.

In short

3 breaking24 new2 faster11 fixed

  • Breaking

    StreamOrchestrator (@langchain/langgraph-sdk/ui) now keeps a run going when its tab closes, and picks it up again:

  • Breaking

    Runs are created with streamResumable and onDisconnect: "continue", and each thread load joins the thread's running run from the loaded checkpoint.

  • Breaking

    stop() stops the stream at once and cancels the run on the server, also a run it picked up after a load. A run whose id hasn't arrived yet is cancelled once it does. A run the app joins with joinStream() keeps going, and stop({ cancel: false }) and dispose() leave any run going.

    To check

Release note

Minor Changes

  • New in StreamOrchestrator (@langchain/langgraph-sdk/ui): subagent panels that stream only while they are open.

    • scopes.acquire(namespace) holds the scope of a subgraph, such as a subagent's panel, and returns { getSnapshot, subscribe, release }. A snapshot has the subgraph's messages, as BaseMessage instances, and its latest values. All held scopes of a run share one join of it from its start, which the server filters to their namespaces when it can. A subagent no run is streaming is read once from the thread's history.

    • scopedSubagents: true streams each subagent only to its scopes and keeps its messages out of the main conversation, as filterSubagentMessages does. Runs then stream subgraphs, queued ones too, and on a server with the stream_namespaces and stream_lifecycle flags in /info, a run's own stream carries only the main conversation and the subagents' lifecycle events. A joined run does the same when it was created that way. It's off by default, since subagents then has a subagent's status and result but not its messages on such a server: they come from its scope.

    • resolveSubagentNamespace(toolCallId) finds a subagent's namespace after a reload, from its tool message or one small page of the thread's history.

    • Panel joins wait while four of the page's engine streams are open, so stop() and respond() keep a free connection on servers that speak only HTTP/1.1, such as langgraph dev.

  • StreamOrchestrator (@langchain/langgraph-sdk/ui) reads subagent and tool events:

    • With filterSubagentMessages, runs ask the server for lifecycle events, and with onToolEvent, for tools events, when the server sends them on run streams. It reads /info once per client to know. onToolEvent fires now: runs never asked for tools before. A server that refuses them with a 422, such as an older one during a rollout, gets the run again without them.

    • Each subagent is tied to the tool call that started it, from its lifecycle events or from the tool call id deepagents puts on a subagent's tokens, so subagents with the same task text no longer swap. A subagent whose graph fails shows the error at once. Subagents still open when the server says their run failed or was cancelled, or when stop() cancels it, end with an error. A run paused at an interrupt, a dropped connection or stop({ cancel: false }) leaves them open.

    • onChannelEvent(listener) hands every event of its streams to the listener in @langchain/react 1.x's channel shape, { method, params: { namespace, timestamp, data } }. CustomStreamOrchestrator has it too.

    In StreamOrchestrator and the useStream hook from @langchain/langgraph-sdk/react, when the server restarts a run (a worker stops, or a deploy outlasts the run), the main conversation drops what the cut attempt half-streamed and keeps what its finished steps wrote, instead of showing both. A subagent card that only the cut attempt's message started goes too.

  • Add client.info(), which reads the server's version and the features it supports (flags) from GET /info. client.runs.stream() and client.runs.joinStream() take per-call reconnect options: maxReconnectAttempts (with 0, a dropped stream throws instead of reconnecting), reconnectDelayMs, onReconnect (called with attempt, cause, lastEventId and delayMs) and onConnected. client.threads.joinStream() also sends its modes as one comma-joined stream_modes, the only form older servers read. The Run type has kwargs.

  • StreamOrchestrator (@langchain/langgraph-sdk/ui) now keeps a run going when its tab closes, and picks it up again:

    • Runs are created with streamResumable and onDisconnect: "continue", and each thread load joins the thread's running run from the loaded checkpoint.

    • stop() stops the stream at once and cancels the run on the server, also a run it picked up after a load. A run whose id hasn't arrived yet is cancelled once it does. A run the app joins with joinStream() keeps going, and stop({ cancel: false }) and dispose() leave any run going.

    • durableRuns: false keeps a run tied to its tab, as before this release.

    New options: onRunEnd({ runId, reason }), with "success", "error", "interrupt" or "stopped", and maxReconnectAttempts, reconnectDelayMs, onReconnect, onConnected and streamIdleReconnect, passed to every run stream and join. New methods: hydrate(threadId?), hydrationPromise and a StrictMode-safe activate().

    A join of the run being submitted waits for its id, so the run doesn't stream twice, and a server-queued submit waits for that run to exist, so it can't overtake it. Runs it creates send config.configurable.__event_streaming_v2: false, so a thread a v3 client used streams the shape this engine reads, unless they send context, which the Agent Server doesn't take together with configurable.

  • StreamOrchestrator (@langchain/langgraph-sdk/ui) now keeps metadata per message id in messageMetadataStore:

    • parentCheckpointId is the checkpoint to fork from to edit the message. Between trackMessageMetadata() and its release, the engine reads it from the thread's history whenever it is idle with messages it hasn't placed yet: after a load, and after each run back to the checkpoints it already read. It reads what each step wrote, about 1 KB a step, and the whole messages only for messages no step wrote, such as ones added with updateState. Messages more than about 500 steps back get none.

    • optimisticStatus is pending for an optimistic message until a values event of its run holds it, then sent. A run that fails or is stopped before that marks it failed, and one that succeeds or pauses marks it sent. A reload clears it.

    Every message a submit sends now carries an id, also with optimistic: false and for a run queued on the server. MessageMetadataMap and OptimisticStatus are exported.

  • New in StreamOrchestrator (@langchain/langgraph-sdk/ui):

    • respond(value, { interruptId? }) answers an interrupt, the newest one when no id is given, and respondAll({ [interruptId]: value }) answers several in one run. Both take update, goto, config, metadata and strictResume. They ask for strict resume unless strictResume is false, so an answer to an interrupt that is no longer waiting fails its run instead of running the step again. During a run, the answer waits in the queue instead of interrupting it. An answered interrupt is hidden until its run ends, and shows again if the answer fails. The promise resolves once the run is created or queued.

    • A submit's input shows at once. Input messages without an id get one, so the run's copies replace them. Passing optimisticValues shows those instead, and optimistic: false turns this off.

    • queue: "local" keeps a submit made during a run on the client and sends it once the run ends, instead of queueing it on the server.

    • Interrupts carry the namespace they were raised in.

    A submit with multitaskStrategy: "interrupt" or "rollback" during a run now replaces that run's stream at once, as useStream does, instead of waiting for it to end. A submit queued behind a run now sends its strictResume too.

  • StreamOrchestrator (@langchain/langgraph-sdk/ui) now follows its thread between activate() and dispose:

    • A run started elsewhere, such as in another tab or by a cron, is joined and streams here. A run that ended elsewhere reads the thread again, and an interrupt answered elsewhere is hidden at once.

    • It keeps one connection to the thread's lifecycle stream, closed while a run streams here, while the queue holds runs and while the page is hidden, and it resumes from the last event it saw. On a server without a thread stream it stays off after one request.

    • watchThread: false turns it off.

    Each thread load also lists the thread's queued runs, so a run queued before a reload shows in the queue again and streams when its turn comes. Since another client may have queued them, a thread switch leaves them on the server, while cancelQueueItem() and clearQueue() still cancel them. The queue now also moves on when a joined run ends.

  • @langchain/langgraph-sdk/ui now exports:

    • SubgraphDiscovery, with its SubgraphDiscoverySnapshot, SubgraphMap and SubgraphByNodeMap types. Its push() takes any event with a method, params.namespace and params.data, such as the ones StreamOrchestrator.onChannelEvent gives.

    • seedToolCallsFromMessages, which builds AssembledToolCalls from messages, and the AssembledToolCall and ToolCallStatus types.

    • AssembledToolCallFromTool, and InferAssembledToolCalls, which @langchain/langgraph-sdk/stream exports as InferToolCalls. The InferToolCalls that ./ui already exports infers message tool calls and is unchanged.

    @langchain/langgraph-sdk/stream exports the same names and types as before.

Patch Changes

  • After a reload, useStream now requests only checkpoints and tasks from /history to match subagents to their cards. The Python Agent Server 0.17.0 and later then leaves out the thread's values, so on a 20-turn thread the response drops from 55 MB to 298 KB. Subagent cards also no longer show another subagent's messages, or none, when another tool call in the same AIMessage was answered before the subagents started, for example one a human rejected. JS graphs need @langchain/langgraph 1.7.2 or later for that case. On older versions, unfinished subagents from that step show no messages after a reload.

  • StreamOrchestrator (@langchain/langgraph-sdk/ui) handles four cases the way @langchain/react 1.x apps expect:

    • A thread switch no longer shows the last thread's messages, error or selected branch while the new thread loads. values falls back to initialValues, and isThreadLoading is true until the read lands.

    • A thread id that doesn't exist yet, such as one minted in the browser for a new chat, loads as an empty thread with no error, and the first submit on it creates it with POST /threads and that id before its run, so the app's threads.create auth handler runs. A submit made while the thread loads waits for the load. A link to a deleted thread shows it empty, and its first submit creates it again. A thread that exists by the time of that create, such as one another tab created, is used as it is when the user's auth can read it, and refused otherwise.

    • A tool call whose tool message has status: "error" reads as failed, with the message's text as error, instead of finished. This applies to @langchain/react 1.x too: after a reload, and when a tool returns an error message of its own, which the tools channel reports as finished.

    • resolveSubagentNamespace(toolCallId) shares one lookup between callers that ask for the same subagent at the same time, so the hooks of one subagent panel read the thread's history once after a reload.

  • StreamOrchestrator.joinStream(runId) now does nothing when runId is the run it is already streaming (from submit() or an earlier join, including the one reconnectOnMount starts) or has queued, and returns that stream's promise. Previously the second join waited for the current stream to end and then replayed the whole run, with a second loading phase and another history read. A run whose stream stop() or a thread switch cut off can still be joined again right away.

  • In StreamOrchestrator (@langchain/langgraph-sdk/ui), a new thread's first message shows as soon as it is submitted, as in @langchain/react 1.x. It showed only once POST /threads had created the thread. A new thread's create that fails no longer leaves an unhandled promise rejection, and a submit made meanwhile creates a thread itself instead of rejecting.

  • StreamOrchestrator.submit() with multitaskStrategy: "reject" while another run is streaming now sends "reject" to the server instead of queuing the run, so the server's rejection reaches onError. Submits with no strategy are still queued.

  • Runs that StreamOrchestrator.submit() queues while another run is streaming now request the same stream modes as a direct submit. Previously the queued run was created without streamMode, so the server only produced values events for it: once the queue drained, replies arrived in one piece instead of token by token, and updates, custom, tool and message-tuple consumers received nothing.

  • Resumable run streams and joins reconnect when the server sends no readable Location header, as with the JS dev server or a CORS config that doesn't expose it. For a resumable run, client.runs.stream() rebuilds the reconnect path from the run's Content-Location, threadless runs included, or from its thread and run id, and client.runs.joinStream() reconnects to its own URL. When Content-Location is hidden too, onRunCreated fires with the run id from the run's metadata event. Aborting a stream during the wait before a reconnect now ends it at once, not after the wait.

  • client.runs.stream() and client.runs.joinStream() called with streamNamespaces now drop the events outside those namespaces themselves, by the same rule as the Agent Server. A server that doesn't support the filter (an older version, or the JS dev server) sent every event before, and now gives the same events as one that does. onToolEvent no longer gets tool events of kinds other than on_tool_start, on_tool_event, on_tool_end and on_tool_error, which older queue workers forward for Python graphs.

  • sdk: useStream from @langchain/langgraph-sdk/react now calls the onError passed to submit() when that run fails, after the hook's own onError. It was typed and documented but never called, on both the LangGraph server and the custom transport paths.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.