Skip to content

Commit 14aec05

Browse files
committed
Investigate abort flow bugs
1 parent bdc9ba5 commit 14aec05

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/routes/conversation/[id]/+page.svelte

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@
421421
await sendStopRequest();
422422
} catch (retryErr) {
423423
console.error("Failed to stop generation", firstErr, retryErr);
424-
stopRequested = false;
425424
$error = "Failed to stop generation. Please try again.";
426425
}
427426
}
@@ -442,7 +441,7 @@
442441
$pendingMessage = undefined;
443442
}
444443
445-
const streaming = isConversationStreaming(messages);
444+
const streaming = isConversationGenerationActive(messages);
446445
if (streaming) {
447446
addBackgroundGeneration({ id: page.params.id, startedAt: Date.now() });
448447
$loading = true;
@@ -477,12 +476,13 @@
477476
messages = data.messages;
478477
});
479478
480-
function isConversationStreaming(msgs: Message[]): boolean {
481-
return isConversationGenerationActive(msgs);
482-
}
479+
$effect(() => {
480+
page.params.id;
481+
stopRequested = false;
482+
});
483483
484484
$effect(() => {
485-
const streaming = isConversationStreaming(messages);
485+
const streaming = isConversationGenerationActive(messages);
486486
if (stopRequested) {
487487
$loading = false;
488488
} else if (streaming) {

0 commit comments

Comments
 (0)