Fix: Filter system messages when loading from localStorage to handle legacy data

This commit is contained in:
Russell Ballestrini 2025-07-01 10:40:58 -04:00
parent f13fc85d21
commit 340241c886

View file

@ -20,7 +20,8 @@ export function loadConversationHistory() {
if (saved) {
try {
const parsedHistory = JSON.parse(saved);
return parsedHistory;
// Filter out any system messages that might have been saved before our fix
return parsedHistory.filter(msg => msg.role !== 'system');
} catch (e) {
console.error('Error parsing conversation history:', e);
}