File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -635,6 +635,9 @@ class MemoryRunStore implements TriggerChatRunStore {
635635}
636636```
637637
638+ ` reconnectToStream() ` only resumes active streams. When a stream completes or errors,
639+ the transport clears stored run state and future reconnect attempts return ` null ` .
640+
638641## Complete Example: AI Streaming
639642
640643### Define the stream
Original file line number Diff line number Diff line change @@ -119,6 +119,12 @@ class MemoryStore implements TriggerChatRunStore {
119119` onTriggeredRun ` can also be async, which is useful for persisting run IDs before
120120the chat stream is consumed. Callback failures are ignored so chat streaming can continue.
121121
122+ ## Reconnect semantics
123+
124+ - ` reconnectToStream({ chatId }) ` resumes only while a stream is still active.
125+ - Once a stream completes or errors, its run state is cleaned up and reconnect returns ` null ` .
126+ - Provide a custom ` runStore ` if you need state shared across processes/instances.
127+
122128## ` ai.tool(...) ` example
123129
124130``` ts
You can’t perform that action at this time.
0 commit comments