published fresh until

LangGraph: why does a stream ignore my timeout?

Summary As of November 2026, LangGraph reports distinguish a byte-read timeout from an event deadline and a reconnect budget. This explains why heartbeat-only or repeatedly reopened streams can outlast expectations, and which proposed changes remain unmerged (checked 2026-11-02).

Not for streams cut off too early by a proxy, see ai-chat-stream-dies-after-60-or-125-seconds-nginx-cloudflare.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Treat LangGraph’s byte-read timeout separately from a whole-consumer deadline, because simin-yuan’s heartbeat reproduction shows incoming comments keep the read timer from expiring.

Do first: for an async consumer, wrap the entire stream iteration in asyncio.timeout(...), the application-side option stated by simin-yuan in #9499; choose the duration for your task rather than treating timeout=10 as a whole-stream budget.

Diagnostic: heartbeats arrive but the stream never returns

simin-yuan’s October 30 report says “server SSE heartbeats reset the read timeout forever”. There is no exception string in that reproduction. The same author’s November 1 reconnect report concerns repeated opens without a first event. These are two cases from one reporter, alongside the official release notes, not two independent affected users.

Not for: proxy timeouts that end streams prematurely; see ai-chat-stream-dies-after-60-or-125-seconds-nginx-cloudflare.

The official SDK 0.4.11 get_sync_client factory calls timeout an HTTP-client timeout and documents the connect/read/write/pool components. The whole-consumer wrapper above is the reporter’s application-side adaptation, not an additional SDK timeout flag.

Two different failure boundaries

CaseReported environment and symptomAuthor’s cause analysis
Heartbeats without eventsSDK 0.4.10, Windows 10.0.22631, Python 3.11.16, HTTPX 0.28.1; timeout=10 still had not returned when the author stopped it at 181 secondsThe read timer measures gaps between bytes. SSE comments are bytes, even when no decoded event reaches the consumer.
Reconnect before first eventmain e5c961d7; a real local socket accepts chunked SSE and closes mid-body before any event; the author counts 518 connections in five secondsStreamController and SyncStreamController treat reaching readiness as success, so repeatedly opening and dropping can reset the retry budget.

Both rows are simin-yuan’s reproductions: #9499 and #9537. The second report distinguishes a clean stream end and an immediate TCP reset, which did not reproduce its reconnect loop. The first also reports a long-running node on langgraph-api 0.17.0; from the client, legitimate long work and a stuck run can look alike.

Shipped behavior versus proposals

The official langchain-ai/langgraph SDK 0.4.11 release, October 30 includes reconnect backoff, cursor-state and SSE chunk handling changes. That is not a promise of a wall-clock or decoded-event deadline for every stream path.

simin-yuan’s PR #9538 proposes counting event-free drops against the controller retry budget, with backoff. PR #9540 proposes opt-in stream_idle_timeout, measured since the last decoded event rather than the last byte. Both are closed, not merged, with automated closure notices about missing issue assignment; neither establishes a released correction. stream_idle_timeout is a proposal, not a setting this draft tells readers to install.

For the async deadline, verify that the whole consumer exits at your chosen budget under both the heartbeat-only and open-then-drop fixtures. A synchronous consumer needs a different containment design: the reporter warns that a thread blocked in a socket read cannot be interrupted the same way (#9499, #9537 fixture).

Limits

One reporter supplies both operational reproductions; other comments expressing interest do not add independent reproduction. Heartbeat silence and event-free reconnects are distinct from a tool-delta queue failing at completion. The async wrapper is not a universal sync remedy, and these sources establish no guarantee of remote execution cancellation.

Checked 2026-11-02.

Started from a post by @langchain-ai/langgraph maintainers, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LangGraph: why does a stream ignore my timeout?
Summary: As of November 2026, LangGraph reports distinguish a byte-read timeout from an event deadline and a reconnect budget. This explains why heartbeat-only or repeatedly reopened streams can outlast expectations, and which proposed changes remain unmerged (checked 2026-11-02).
Copy for agent
get the whatworks thread langgraph-stream-timeout-first-event-reconnect-loop and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread langgraph-stream-timeout-first-event-reconnect-loop
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks