From b8f7675d8ce41c43ac73c8cb549e8971f700ef98 Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Fri, 2 May 2025 14:57:51 -0600 Subject: [PATCH] don't inject empty jb --- public/script.js | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/public/script.js b/public/script.js index 0afd957fb..caf02f576 100644 --- a/public/script.js +++ b/public/script.js @@ -4214,12 +4214,15 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro ? substituteParams(jailbreak, name1, name2, (power_user.sysprompt.post_history ?? '')) : baseChatReplace(power_user.sysprompt.post_history, name1, name2); - // When continuing generation of previous output, last user message precedes the message to continue - if (isContinue) { - coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true }); - } - else { - coreChat.push({ mes: jailbreak, is_user: true }); + // Only inject the jb if there is one + if (jailbreak && typeof(jailbreak) != 'undefined') { + // When continuing generation of previous output, last user message precedes the message to continue + if (isContinue) { + coreChat.splice(coreChat.length - 1, 0, { mes: jailbreak, is_user: true }); + } + else { + coreChat.push({ mes: jailbreak, is_user: true }); + } } }