LangGraph.js (@langchain/langgraph) shipped patch v1.7.3 on November 9, 2026. According to the official release notes and Pull Request #3090 (contributed by OsamaAnsar), this release resolves a persistent async coordination issue where agent node executions continued indefinitely after a consumer disconnected or broke out of a stream.

The Bug: Orphaned Runs and Silent Token Waste

When a user clicks "Stop generating" or closes a browser tab, server-side streaming endpoints typically break out of their asynchronous iteration loop:

// Problematic consumer pattern in v1.7.2
for await (const chunk of await graph.stream(inputs)) {
  if (clientDisconnected()) {
    break; // In <= v1.7.2, background nodes kept executing despite this break
  }
}

Prior to v1.7.3, breaking out of a for await...of loop or closing the stream reader did not signal the underlying graph runner to abort. Unless the developer explicitly invoked stream.cancel(), the graph runner continued orchestrating subsequent nodes in the background.

This created two distinct operational problems:

  1. Unwanted LLM Invocations: The agent continued calling models and executing tool chains for responses that would never be displayed, wasting API quota and computing resources.
  2. Controller Race Conditions: Downstream handlers like StreamMessagesHandler frequently crashed with TypeError [ERR_INVALID_STATE]: Controller is already closed when attempting to push late-arriving chunks into an already-terminated stream.

Changes in v1.7.3

Version 1.7.3 wires the generator's return() and reader cancellation handlers directly into the graph cancellation machinery:

  • Automatic Loop Exit Detection: Hitting a break, return, or unhandled throw inside a for await...of loop over graph.stream() or graph.streamEvents() immediately terminates the active graph execution run.
  • AbortSignal Propagation: The active run's internal AbortController triggers, cancelling pending HTTP requests to model providers and aborting in-flight tool tasks.
  • Clean Stream Handler Teardown: Internal handlers like StreamMessagesHandler properly check cancellation status before pushing state, eliminating ERR_INVALID_STATE exceptions.

Version Comparison: 1.7.2 vs 1.7.3

Scenario Behavior in <= 1.7.2 Behavior in 1.7.3
break in for await loop Loop terminates, but graph continues executing in background Graph run terminates immediately; remaining nodes cancelled
Client disconnect (SSE/WebSocket) Server keeps generating and burning tokens Stream cancellation propagates upstream to abort LLM calls
Explicit stream.cancel() omitted Resource and token leak Clean automatic reclamation on generator return
Server log stability Intermittent ERR_INVALID_STATE errors Clean lifecycle termination without orphan errors

For engineering teams running streaming agent backends on LangGraph.js, upgrading to 1.7.3 is a high-value fix that directly stops token waste on client cancellations.

Source: LangGraph.js v1.7.3 Release and PR #3090.