Packages

@langchain/langgraph-api

1.8.1 · 20 Nov 2026MIT193.1k / weekRepositoryHomepagenpmAtom feed

Your version

1.5.7

30 Oct 2026Where it was published

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_disconnect is cancel

    POST /runs/stream never 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 with on_disconnect: "cancel" now stops when its request drops, as thread runs already did, and GET /runs/:run_id/stream?cancel_on_disconnect=true gets 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 an interrupted run and its thread behind. Runs created with on_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 honor stream_mode as the Agent Server does, so client.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 without stream_mode are unchanged.

  • A run created on a busy thread without a multitask_strategy is 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 messages mode, each chat model reply streams under one message id. Anthropic sets the id only on a reply's first chunk, so messages/partial could switch to a run-<runId> id mid-reply that never matched the id in messages/complete.

    • In messages mode with stream_subgraphs: true, messages/complete is 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 generator RunnableLambda called with the node's config) no longer fails the run with TypeError: 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 running forever, their thread stayed busy and new runs on it were rejected with 422.

  • The rollback multitask strategy, and cancelling with action=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 as error and 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.