fix: address feedback

This commit is contained in:
Nate 2025-08-05 10:32:22 -04:00
parent 73135ffdc5
commit 49ff60026c

View file

@ -494,8 +494,12 @@ export function useChat({
]);
try {
if (!llmApi) {
throw new Error("LLM API is not available for auto-compaction");
}
// Compact the history WITHOUT the current user message
const result = await compactChatHistory(chatHistory, model, llmApi!);
const result = await compactChatHistory(chatHistory, model, llmApi);
// Update local variables immediately
currentChatHistory = result.compactedHistory;