Merge pull request #33 from continuedev/fix-resume

fix resume
This commit is contained in:
Nate Sesti 2025-07-15 19:34:13 -07:00 • committed by GitHub
commit 48caae9e13
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,
};
}
}