@langchain/langgraph-api
1.8.1 · 20 Nov 2026MIT193.1k / weekRepositoryHomepagenpmAtom feed
1.8.1 is the newest release of 1.x.
In short
9 fixed1 internal
Release note
Patch Changes
langgraph-api: Cancel a stateless streamed run when its request drops and
on_disconnectiscancelPOST /runs/streamnever cancelled its run when the client went away, before or after the response started, because the stream only cancelled runs it joined with a thread id. A stateless run created withon_disconnect: "cancel"now stops when its request drops, as thread runs already did, andGET /runs/:run_id/stream?cancel_on_disconnect=truegets the same fix. Cancelling a stateless run that has not started yet now deletes the run, and its temporary thread when no other run is left on it, instead of leaving aninterruptedrun and its thread behind. Runs created withon_disconnect: "continue"keep running.The dev server's run stream joins (
GET /threads/:thread_id/runs/:run_id/stream,GET /runs/:run_id/stream) now honorstream_modeas the Agent Server does, soclient.runs.joinStream(..., { streamMode })drops other modes' events instead of returning all of the run's events. Errors always pass, and either messages mode keeps both message formats. Joins withoutstream_modeare unchanged.A run created on a busy thread without a
multitask_strategyis now queued (enqueue), as on the Agent Server and in the API reference, instead of being rejected with 422.Fix three bugs in the legacy run stream:
In
messagesmode, each chat model reply streams under one message id. Anthropic sets the id only on a reply's first chunk, somessages/partialcould switch to arun-<runId>id mid-reply that never matched the id inmessages/complete.In
messagesmode withstream_subgraphs: true,messages/completeis now sent for the root graph's messages. It was never sent before.With
stream_subgraphs: true, a node that streams a runnable of its own (for example a generatorRunnableLambdacalled with the node's config) no longer fails the run withTypeError: rawTuple is not iterable, in any stream mode.
Runs that were running when the dev server restarted, for example on a hot reload after a file save, are now retried when it starts again and continue from their last checkpoint. Before, they stayed
runningforever, their thread stayed busy and new runs on it were rejected with 422.The
rollbackmultitask strategy, and cancelling withaction=rollback, now roll back a run that is already running, as they already did for a pending one: the run is cancelled, then deleted with its checkpoints, so the next run starts from the state before it, and its stream ends without an error. Before, the run ended aserrorand its writes stayed on the thread.Deleting a thread, or a run, while the run is running no longer stops one of the server's run workers for good, and neither does any other failure while a worker finishes a run, such as a webhook URL that can't be reached. After enough of these, new runs were never picked up.
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.