Merge pull request #90 from tomt610/feature/history-persistence
Feature/history persistence
This commit is contained in:
@@ -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, onGenerationEndedCleanup } from '../generation/injector.js';
|
||||
import { onGenerationStarted, initHistoryInjectionListeners } from '../generation/injector.js';
|
||||
|
||||
// Rendering
|
||||
import { renderUserStats } from '../rendering/userStats.js';
|
||||
@@ -467,9 +467,6 @@ 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)
|
||||
|
||||
@@ -477,3 +474,11 @@ export async function onGenerationEnded() {
|
||||
// Re-apply checkpoint if one exists
|
||||
await restoreCheckpointOnLoad();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize history injection event listeners.
|
||||
* Should be called once during extension initialization.
|
||||
*/
|
||||
export function initHistoryInjection() {
|
||||
initHistoryInjectionListeners();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user