We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 70d297c commit 9974f22Copy full SHA for 9974f22
packages/ai/src/chatTransport.ts
@@ -198,7 +198,15 @@ export class TriggerChatTransport<
198
return null;
199
}
200
201
- const stream = await this.fetchRunStream(runState, undefined, runState.lastEventId);
+ let stream: ReadableStream<SSEStreamPart<InferUIMessageChunk<UI_MESSAGE>>>;
202
+ try {
203
+ stream = await this.fetchRunStream(runState, undefined, runState.lastEventId);
204
+ } catch {
205
+ runState.isActive = false;
206
+ await this.runStore.set(runState);
207
+ await this.runStore.delete(options.chatId);
208
+ return null;
209
+ }
210
211
return this.createTrackedStream(runState.chatId, stream);
212
0 commit comments