Fix cfgMessage handling

d2cc8b36b8c2f2e3d81b3c76a852250d37a52615

Cohee <18619528+Cohee1207@users.noreply.github.com>

1 files changed, +3 -0Showing whitespace changes
public/script.js+3 -0
@@ -4467,6 +4467,8 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4467 // TODO: Make all extension prompts use an array/splice method4467 // TODO: Make all extension prompts use an array/splice method
4468 const lengthDiff = mesSend.length - cfgPrompt.depth;4468 const lengthDiff = mesSend.length - cfgPrompt.depth;
4469 const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0;4469 const cfgDepth = lengthDiff >= 0 ? lengthDiff : 0;
4470 const cfgMessage = finalMesSend[cfgDepth];
4471 if (cfgMessage) {
4470 if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) {4472 if (!Array.isArray(finalMesSend[cfgDepth].extensionPrompts)) {
4471 finalMesSend[cfgDepth].extensionPrompts = [];4473 finalMesSend[cfgDepth].extensionPrompts = [];
4472 }4474 }
@@ -4474,6 +4476,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
4474 }4476 }
4475 }4477 }
4476 }4478 }
4479 }
44774480
4478 // Add prompt bias after everything else4481 // Add prompt bias after everything else
4479 // Always run with continue4482 // Always run with continue