From 0088333ebf52376f3e83f4f76b8dc05a87283e24 Mon Sep 17 00:00:00 2001 From: Cohee <18619528+Cohee1207@users.noreply.github.com> Date: Mon, 3 Mar 2025 00:05:35 +0200 Subject: [PATCH] WI: Fix adding empty text to recursion buffer --- public/scripts/world-info.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index ed558ff1d..7fda4f65f 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -4264,8 +4264,10 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) { if (scanState) { const text = successfulNewEntriesForRecursion .map(x => x.content).join('\n'); - buffer.addRecurse(text); - allActivatedText = (text + '\n' + allActivatedText); + if (text) { + buffer.addRecurse(text); + allActivatedText = (text + '\n' + allActivatedText); + } } else { logNextState('[WI] Scan done. No new entries to prompt. Stopping.'); }