()
| 247 | |
| 248 | // Initialize chat history with system message only if we don't have a session |
| 249 | const initializeHistory = async () => { |
| 250 | // Only add system message if we don't have any messages yet |
| 251 | if (chatHistory.length === 0) { |
| 252 | const history = await initChatHistory(resume, initialRules); |
| 253 | setChatHistory(history); |
| 254 | } |
| 255 | setIsChatHistoryInitialized(true); |
| 256 | }; |
| 257 | |
| 258 | initializeHistory(); |
| 259 | // Note: Using initialRules instead of additionalRules to prevent re-initialization |
no test coverage detected