diff --git a/src/ui.js b/src/ui.js
index 1f98358..5343ddb 100644
--- a/src/ui.js
+++ b/src/ui.js
@@ -629,7 +629,7 @@ async function openHermesModalNew() {
titleContainer.style.cssText = `flex: 1; display: flex; flex-direction: column; gap: 4px;`;
const title = document.createElement("h2");
- title.textContent = "🤖 Hermes AI";
+ title.textContent = "🤖 uncloseai.";
title.style.cssText = `
margin: 0;
font-size: ${isMobile ? '18px' : '20px'};
@@ -640,7 +640,7 @@ async function openHermesModalNew() {
const pageTitle = document.title || window.location.hostname;
subtitle.innerHTML = `
- uncloseai. presents nous research's hermes large language model
+ uncloseai. presents nous research's
hermes large language model
You are discussing: ${pageTitle}
`;
@@ -1106,13 +1106,16 @@ async function openHermesModalNew() {
aiMsg.innerHTML = marked.parse(response);
}
- // Get the updated chat history from chat.js module
- const { getChatHistory } = await import('./chat.js');
- const updatedHistory = getChatHistory();
+ // Add the AI response to chat history manually since sendMessage generator doesn't do it
+ const { getChatHistory, updateChatHistory } = await import('./chat.js');
+ const currentHistory = getChatHistory();
+ currentHistory.push({ role: 'assistant', content: response });
+ updateChatHistory(currentHistory);
// Save conversation history after successful response
- saveConversationHistory(updatedHistory);
- console.log("Conversation history saved:", updatedHistory.length, "messages");
+ saveConversationHistory(currentHistory);
+ console.log("Conversation history saved:", currentHistory.length, "messages");
+ console.log("Saved history content:", currentHistory.map(msg => ({ role: msg.role, content: msg.content.substring(0, 50) + '...' })));
// Add TTS and delete buttons to AI message
const messageActions = document.createElement("div");
@@ -1269,6 +1272,8 @@ async function openHermesModalNew() {
const loadHistory = async () => {
try {
const history = loadConversationHistory();
+ console.log("Raw history from localStorage:", history);
+ console.log("History length:", history ? history.length : 0);
if (history && history.length > 0) {
// Set up page context for existing conversation
const pageContent = extractWebpageContent();
@@ -1299,7 +1304,6 @@ You have complete knowledge of this page content and can reference any details,
// Update the chat.js module's history
updateChatHistory(newHistory);
console.log("Chat history synced with loaded data:", newHistory.length, "messages");
- console.log("Current chatHistory contents:", chatHistory);
console.log("History to display:", history);
// Display previous conversation
history.forEach((msg, index) => {