Packages

@langchain/langgraph-sdk

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

Your version

1.17.0

Latest17 Nov 2026Where it was published

In short

2 new15 fixed11 changed

Release note

Minor Changes

  • CustomStreamOrchestrator (@langchain/langgraph-sdk/ui), the engine for custom transports:

    • A submit stays on the thread the first one created, also one made while that run streams. Every submit after the first started a new thread.

    • A submit keeps the values shown and shows its input at once, instead of showing initialValues until the server answered. The messages shown at once go to the transport as dicts with ids, so the server's copy replaces them, and a backend should keep those ids. optimistic: false shows nothing early and sends the input as passed. initialValues show until a run streams, and only on the first thread.

    • A submit made during a run is listed in queueEntries until its turn. cancelQueueItem(), clearQueue(), a thread switch and stop() drop it before it starts.

    • respond() and respondAll() send answers through the transport as a resume command, and hide the answered interrupts until that run ends. Without an id, respond() answers the interrupt interrupt shows, the first one. respondAll() resolves once its run starts.

    • hydrate(threadId) switches to that thread and reads nothing, since a custom transport has no thread routes.

    • StreamEngine is the interface a framework binding uses, and both StreamOrchestrator and CustomStreamOrchestrator implement it.

  • ToolCallStatus has a fourth value, "incomplete": the call has no result, and no run can still give one, because the run stopped, failed, or waits on an interrupt, or a later message closed the call's turn. seedToolCallsFromMessages gives it to such calls. Pass { isLoading: false } when no run streams. It defaults to true, which leaves the calls of the latest turn "running" as before. Calls assembled from tools events don't get it. On 1.x bindings, a subagent panel loaded from history now shows an earlier turn's unanswered call as "incomplete". Code that switches over every ToolCallStatus needs a case for the new value.

  • useStream accepts stateKeys, the values keys your UI reads. Opening a thread then sends select on GET /threads/{thread_id}/state for those keys, the messages key, and the top-level fields the hook reads itself, so the server can skip the rest of the state. stream.values contains only those keys plus the messages key, after loading and while a run streams, including on a server that ignores select. A custom adapter's getState receives { select }, and HttpAgentServerAdapter forwards it. Without stateKeys, nothing changes.

Patch Changes

  • When a CustomStreamOrchestrator run fails before sending values, the keys other than messages that its submit showed go back to what they were, or away if they were new. Its message stays. A run that sent values shows the transport's, and one that succeeds, pauses or is stopped without them keeps the keys as shown, since a transport needn't send values.

  • StreamOrchestrator no longer takes the frames of a run @langchain/react 1.x started for its state. A page that moved to @langchain/react 2.0 while such a run went on joined it, by opening its thread, by joining a run 1.x queued, or when its thread watcher saw the run start. On the Agent Server its messages then went away until the run ended. On the JS dev server it stopped loading before the run ended and missed the run's last message until a reload.

    Now such a run's join reads only its metadata, error and end events. The page keeps what it showed and stays loading until the run ends, then shows the thread's state. A subagent panel open meanwhile reads its history instead of joining the run. These runs are told apart by the run the engine lists or reads before it joins, with no other request.

  • After loading a thread whose last task failed, StreamOrchestrator and the useStream hook from @langchain/langgraph-sdk/react show a task error the server returns as an object, { message, name }, as an Error with that message. They showed the plain object, which reads as "[object Object]" as text and isn't an Error. A task error returned as a string shows as before.

  • When a StreamOrchestrator run ends without sending values, such as one whose assistant doesn't exist, the keys other than messages that its submit showed at once go back to what they were, or away if they were new. Its message stays, marked failed. A stopped run leaves them to the stop's read of the thread, and a run that sent values shows the server's, as before.

  • StreamOrchestrator.resolveSubagentNamespace() now finds the namespace of a subagent its run hasn't started yet. The engine lists a subagent as soon as the main agent's task call streams, before the run starts it and gives it a namespace. A lookup made then found nothing in the thread's history and resolved undefined, so a @langchain/react 2.0 panel opened on that subagent stayed empty, also after the subagent ran, unless the app passed the panel a newer copy of the subagent. Now a lookup that finds nothing while the run streams waits until the run starts the subagent, or until either ends, and looks again. A lookup whose run ends without starting the subagent still resolves undefined.

  • StreamOrchestrator creates the runs of submits made during a run one after another, in submit order. It sent each create at once, so the server could queue, and run, them in the order the requests arrived. A create that fails doesn't hold back the next one, and clearQueue() or a thread switch drops the submits still waiting for theirs and cancels the run of one whose create was on its way. A queued run whose create returns after the run before it ended now streams too, instead of waiting for the next run to end.

  • StreamOrchestrator calls onCreated for each run a submit queued on the server, as the run starts streaming and after the run before it called onRunEnd. A submit made during a run never called onCreated before. A queued submit cancelled before its run started never does, and runs other clients queued don't, as before.

  • A stop() right after a submit(), in the same tick, now stops it in StreamOrchestrator and the useStream hook from @langchain/langgraph-sdk/react. The stop came before the submit's stream began and was lost, so the run was created and streamed to the end. Now the stream begins stopped, so neither shows the input or sends anything. A switchThread() right after a submit drops it the same way, where StreamOrchestrator sent it to the new thread.

    StreamOrchestrator calls onRunEnd with reason: "stopped" and no runId for a submit stopped before its run's id came, so runId is optional in onRunEnd's type.

  • After stop(), StreamOrchestrator keeps the inputs it showed that the server didn't save, after the saved messages, until the next run, a reload or a thread switch. A run stopped before the server saved its input lost that input from the page. A reply the stop cut off still goes.

  • A StreamOrchestrator panel on a subgraph shows all of the subgraph's messages again, also those it shares with the main conversation. It left out every message the main conversation showed, so the panel of a subgraph that shares messages with its parent was empty once the subgraph ran. A panel on a subagent, a namespace under a tools: segment, still leaves them out, since deep agents' fork-mode subagents start from a copy of the main conversation's messages.

  • StreamOrchestrator now shows a run that ran on its thread while the page was hidden, also when its thread watcher had no event to resume from. The watcher closes while the page is hidden and resumes from its last event when the page shows again. It takes event ids only from the thread's stream, and the page's own runs stream on their run's stream, so a watcher that has seen no run started elsewhere has none. Its stream then started live, and a run another tab, a cron or a trigger ran meanwhile showed only after a reload. Now such a watcher reads the thread's state once as the page shows again, as after a gap. A watcher with an event id resumes from it as before.

  • CustomStreamOrchestrator reports each run's lifecycle itself, as StreamOrchestrator does, so framework bindings don't have to work it out from its state:

    • onCreated gets the run id from the first metadata event of each run's stream. The option was accepted before and never called.

    • The new onRunEnd option gets { runId, reason } when each run's stream ends, before its submit() resolves. The reason is "interrupt" when the stream sent an interrupt, "error" when it failed, also by timing out, "stopped" when it was aborted, as by stop() or a thread switch, and "success" otherwise. A run the engine's dispose() stops isn't reported.

    • An onCreated or onRunEnd that throws is logged, and affects neither the run nor the ones after it.

    • Switching to another thread calls onThreadId, through switchThread(), syncThreadId() or hydrate(). Before, only a submit that created a thread called it.

    • A run that fails or is stopped ends the subagents it left open with an error, as on an Agent Server, instead of leaving them running.

  • A StreamOrchestrator that loads threads now needs activate(), which bindings call from an effect. A thread load before the first activate() reads the thread and holds what it finds until then: the running run's join, the head's headless tool calls and the server's queued runs. Bindings create the engine during a render, and an engine from a render that never commits, such as StrictMode's double render or a suspended tree that unmounts, used to join runs, run tools a second time and send their answers again. A running run a load holds counts as isLoading, so the queue waits for it too. A stream the engine starts before activate(), such as a submit from an effect that runs before the binding's, drops what the load held. respond() with no id now answers the first interrupt shown, as CustomStreamOrchestrator does. StreamController, which the Vue, Svelte and Angular bindings use, still answers the newest. The engine also reads the server's /info at its first activate() instead of when it's built, and warns about a server without subagent lifecycle events only once a subagent's messages are read.

  • StreamOrchestrator shows the interrupts of a thread it loads only after the load has looked for a run still going on that thread, so they show a request or two later than before. When the load found a run in progress, that run's { when: "breakpoint" } placeholder, or an interrupt it had already answered, showed until the join started. Headless tools waiting in the loaded state run after that lookup too, so a reload during a resumed tool run no longer runs the tool again. The lookup gives up after 10 seconds, and the reload after the thread watcher misses events waits the same way. respond() with no id waits for the lookup, and rejects if the thread closes or changes meanwhile. An interrupt already on screen stays shown while hydrate() reads the thread again, and a run started during a load shows its interrupts without waiting for the lookup.

  • With reconnectOnMount, a stop() from useStream before the server has answered the run's request now cancels that run once its id arrives. The hook creates these runs with on_disconnect: "continue", and only the response names the run, so the stop used to close the request and leave the run going on the server. The request now stays open for up to 5 seconds to learn the id, while the UI still stops at once.

  • A subagent rebuilt from a loaded thread's messages takes its namespace from its task tool message when the message records it (artifact.checkpoint_ns, which Python deepagents write), with no request. Before, its namespace stayed empty until something looked it up in the thread's history.

    A subagent the main agent called has depth: 1 also before it runs and after a reload, where it had 0. Once its events streamed, it already had 1.

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.