Protocol v2 Event Stream (SSE)
Open a connection-scoped SSE event stream for a thread. The request body is a ProtocolEventStreamRequest carrying channel and namespace filters; the server replies with Content-Type: text/event-stream and pushes matching ProtocolEvent frames for the lifetime of the connection. Closing the connection unsubscribes — no state is persisted server-side.
Reconnect: clients pass the last seq they received as since in the body. Buffered events with seq > since are replayed before the stream goes live. The endpoint is POST-only, so browser-native EventSource auto-resume (Last-Event-ID) does not apply — clients drive resume explicitly via the body.
Body
Body of POST /threads/{thread_id}/stream/events. Filters the connection-scoped SSE stream.
Channels to subscribe to for the lifetime of this connection.
1Subscribable event channel. One of the eight fixed channels or a user-defined custom:<name> namespaced custom channel emitted by a stream transformer. debug and checkpoints were removed from the protocol in @langchain/protocol@0.0.10 — task-level debug info now flows on the tasks channel, and checkpoint pointers ride on values events as an attached checkpoint envelope.
values, updates, messages, tools, lifecycle, input, tasks, custom Response
SSE event stream
Stream of ProtocolEvent frames. Each SSE frame uses the event's method as the event: field and a JSON-encoded ProtocolEvent as the data: field; id: is set to the event's seq.
If reading the thread's event stream fails, the server ends the stream with a final frame whose event: field is error and whose data: field is a ProtocolError with id: null and error: "unknown_error". That frame has no id: field.
Example frame:
id: 42
event: messages
data: {"type":"event","event_id":"42","seq":42,"method":"messages","params":{"namespace":[],"timestamp":1700000000000,"data":{...}}}

