LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
LangGraph
  • Web
  • Channels
  • Pregel
  • Prebuilt
  • Remote
LangGraph SDK
  • Ui
  • Client
  • Auth
  • React
  • Logging
  • React Ui
  • Utils
  • Server
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
  • Store
LangGraph Checkpoint Redis
  • Shallow
  • Store
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
  • Cli
LangGraph API
LangGraph CLI
LangGraph CUA
  • Utils
LangGraph Supervisor
LangGraph Swarm
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

LangGraph
WebChannelsPregelPrebuiltRemote
LangGraph SDK
UiClientAuthReactLoggingReact UiUtilsServer
LangGraph Checkpoint
LangGraph Checkpoint MongoDB
LangGraph Checkpoint Postgres
Store
LangGraph Checkpoint Redis
ShallowStore
LangGraph Checkpoint SQLite
LangGraph Checkpoint Validation
Cli
LangGraph API
LangGraph CLI
LangGraph CUA
Utils
LangGraph Supervisor
LangGraph Swarm
Language
Theme
JavaScript@langchain/langgraph-sdkuiStreamManager
Class●Since v1.7

StreamManager

Copy
class StreamManager

Constructors

constructor
constructor

Properties

property
error: unknown

Last seen error from the stream, if any. Reset to undefined when a new stream starts.

property
isLoading: boolean

Whether the stream is currently running. true while streaming, false when idle or completed.

property
values: StateType

The current state values of the stream. Updated as streaming events are received.

Methods

method
clear
method
enqueue
method
getActiveSubagents→ SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[]

Get all currently running subagents.

method
getSnapshot→ number

Snapshot token for useSyncExternalStore compatibility.

method
getSubagent→ SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string> | undefined

Get a specific subagent by tool call ID.

method
getSubagents→ Map<string, SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>>

Get all subagents as a Map.

method
getSubagentsByMessage→ SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[]

Get all subagents triggered by a specific AI message.

method
getSubagentsByType→ SubagentStreamInterface<Record<string, unknown>, DefaultToolCall, string>[]

Get all subagents of a specific type.

method
hasSubagents→ boolean

Check if any subagents are currently tracked.

method
reconstructSubagents

Reconstruct subagent state from historical messages.

This method should be called when loading thread history to restore subagent visualization after:

  • Page refresh (when stream has already completed)
  • Loading thread history
  • Navigating between threads
method
setStreamValues
method
start→ Promise<void>
method
stop→ Promise<void>
method
subscribe→ () => void

Subscribe to state changes. Returns an unsubscribe function.

View source on GitHub