Fix history injection for prewarm extensions
- Use persistent event listeners instead of once() to inject into ALL generations - Don't clear context map on GENERATION_ENDED so prewarm gets the same context - Remove unused onGenerationEndedCleanup function
This commit is contained in:
@@ -151,7 +151,8 @@ import {
|
||||
onMessageSwiped,
|
||||
updatePersonaAvatar,
|
||||
clearExtensionPrompts,
|
||||
onGenerationEnded
|
||||
onGenerationEnded,
|
||||
initHistoryInjection
|
||||
} from './src/systems/integration/sillytavern.js';
|
||||
|
||||
// Old state variable declarations removed - now imported from core modules
|
||||
@@ -1018,6 +1019,15 @@ jQuery(async () => {
|
||||
// Non-critical - continue anyway
|
||||
}
|
||||
|
||||
// Initialize history injection event listeners
|
||||
// This must be done before event registration so listeners are ready
|
||||
try {
|
||||
initHistoryInjection();
|
||||
} catch (error) {
|
||||
console.error('[RPG Companion] History injection init failed:', error);
|
||||
// Non-critical - continue without it
|
||||
}
|
||||
|
||||
// Register all event listeners
|
||||
try {
|
||||
registerAllEvents({
|
||||
|
||||
Reference in New Issue
Block a user