Last seen error from the stream, if any.
Reset to undefined when a new stream starts.
Whether the stream is currently running.
true while streaming, false when idle or completed.
The current state values of the stream. Updated as streaming events are received.
Fetch and restore internal messages for reconstructed subagents from their
subgraph checkpoints. Should be called after reconstructSubagents to
restore the full subagent conversation after a page refresh.
Subagent messages are persisted in the LangGraph checkpointer under a
subgraph-specific checkpoint_ns (e.g. tools:<uuid>). This method
discovers the correct namespace by inspecting the main thread's intermediate
history checkpoints, where each pending task's checkpoint.checkpoint_ns
identifies the subgraph. Tasks are matched to tool calls by their Send index
(task.path[1]), which corresponds to the order of tool calls in the AI
message — no deepagent-specific metadata required.
Get all currently running subagents.
Return the current version number, incremented on each state change.
Useful as a cache key for external sync (e.g. useSyncExternalStore).
Look up a single subagent stream by its tool call ID.
Get all subagents as a Map.
Retrieve all subagent streams associated with a specific AI message.
Retrieve all subagent streams matching a given tool name / type.
Check if any subagents are currently tracked.
Reconstruct subagent state from historical messages.
This method should be called when loading thread history to restore subagent visualization after:
Abort the current stream and invoke the onStop callback
if one was provided in the options.
Register a listener that is called whenever the orchestrator state changes.