Skip to content

armgit / jan

Public Imported from GitHub
0

Jan is an open source alternative to ChatGPT that runs 100% offline on your computer.

fix: update wave detection logic to include any non-tool parts after tool parts

atoz9651b0d4d9dc6a
diff --git a/web-app/src/lib/custom-chat-transport.ts b/web-app/src/lib/custom-chat-transport.ts
index 10544cbb3..3b42cb777 100644
--- a/web-app/src/lib/custom-chat-transport.ts
+++ b/web-app/src/lib/custom-chat-transport.ts
@@ -362,8 +362,9 @@ export class CustomChatTransport implements ChatTransport<UIMessage> {
if (isToolPart(part)) {
seenToolParts = true
currentWave.push(part)
- } else if (part.type === 'text' && seenToolParts) {
- // Text after tool parts marks the start of a new wave
+ } else if (!isToolPart(part) && seenToolParts) {
+ // Any non-tool part (text, reasoning, file, etc.) after tool parts
+ // marks the start of a new wave
waves.push(currentWave)
currentWave = [part]
seenToolParts = false