diff --git a/package-lock.json b/package-lock.json index 8ba587817..44090471a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@continuedev/cli", - "version": "1.3.0", + "version": "1.3.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@continuedev/cli", - "version": "1.3.0", + "version": "1.3.1", "license": "Apache-2.0", "dependencies": { "@continuedev/config-yaml": "^1.0.96", diff --git a/src/ui/hooks/useChat.ts b/src/ui/hooks/useChat.ts index c40bfb5bc..be85aa792 100644 --- a/src/ui/hooks/useChat.ts +++ b/src/ui/hooks/useChat.ts @@ -266,8 +266,10 @@ export function useChat({ }, }; + // Call streamChatResponse with the new history that includes the user message + const finalHistory = [...newHistory]; await streamChatResponse( - newHistory, + finalHistory, model, llmApi, controller, @@ -286,7 +288,11 @@ export function useChat({ ]); } - saveSession(newHistory); + // Update the chat history with the complete conversation after streaming + setChatHistory(finalHistory); + + // Save the updated history to session + saveSession(finalHistory); } catch (error: any) { const errorMessage = `Error: ${error.message}`; setMessages((prev) => [ @@ -345,4 +351,4 @@ export function useChat({ handleFileAttached, resetChatHistory, }; -} +} \ No newline at end of file