From afe12e25fe72b686dc9f4eec1e6e680ff04dec56 Mon Sep 17 00:00:00 2001 From: "Scout (Lead Tester)" Date: Thu, 5 Feb 2026 06:57:00 +0000 Subject: [PATCH] fix: address review comments on PINE-49 - Pass temperature and contextOptions to chat() and chatStream() methods - Add multimodal param to upload file flow (types, hook, service) - Guard handleConfirmDelete against null currentProfile - Use stable message.id key instead of array index in ChatView - Fix download race condition by verifying fileDetail matches fileToDownload - Keep file detail cache consistent during delete operations - Handle early stream chunks before stream ID is set --- src/components/assistants/AssistantsPanel.tsx | 2 +- src/components/chat/ChatView.tsx | 2 +- src/hooks/useChatStream.ts | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/assistants/AssistantsPanel.tsx b/src/components/assistants/AssistantsPanel.tsx index a4c46a3..627affe 100644 --- a/src/components/assistants/AssistantsPanel.tsx +++ b/src/components/assistants/AssistantsPanel.tsx @@ -109,7 +109,7 @@ export function AssistantsPanel({ onToggleCollapse, onCreateNew, onEditAssistant }, []) const handleConfirmDelete = useCallback(async () => { - if (!assistantToDelete) return + if (!assistantToDelete || !currentProfile?.id) return // Verify the confirmation input matches the assistant name if (confirmationInput !== assistantToDelete) { diff --git a/src/components/chat/ChatView.tsx b/src/components/chat/ChatView.tsx index 9b2923b..01f0c88 100644 --- a/src/components/chat/ChatView.tsx +++ b/src/components/chat/ChatView.tsx @@ -201,7 +201,7 @@ export function ChatView({ assistantName }: ChatViewProps) {
{messages.map((message, idx) => ( { + // Initialize stream id from first chunk if not yet set (handles race condition) + if (!currentStreamIdRef.current) { + currentStreamIdRef.current = streamId + } if (streamId !== currentStreamIdRef.current) return switch (chunk.type) {