Implement historical context injection for chat messages and enhance settings for persistence

This commit is contained in:
tomt610
2026-01-09 19:39:05 +00:00
parent f5641ec1f0
commit 98ef751a9f
7 changed files with 899 additions and 57 deletions
+4 -1
View File
@@ -30,7 +30,7 @@ import { parseResponse, parseUserStats } from '../generation/parser.js';
import { parseAndStoreSpotifyUrl, convertToEmbedUrl } from '../features/musicPlayer.js';
import { updateRPGData } from '../generation/apiClient.js';
import { removeLocks } from '../generation/lockManager.js';
import { onGenerationStarted } from '../generation/injector.js';
import { onGenerationStarted, onGenerationEndedCleanup } from '../generation/injector.js';
// Rendering
import { renderUserStats } from '../rendering/userStats.js';
@@ -453,6 +453,9 @@ export function clearExtensionPrompts() {
export async function onGenerationEnded() {
// console.log('[RPG Companion] 🏁 onGenerationEnded called');
// Restore original message content that was modified for historical context injection
onGenerationEndedCleanup();
// Note: isGenerating flag is cleared in onMessageReceived after parsing (together mode)
// or in apiClient.js after separate generation completes (separate mode)