Merge pull request #3591 from SillyTavern/revert-3587-fix-miscounted-messages-on-generate-and-swipe Revert "Account for generated depth on non-continue"

696a9992389bca7ec24c3e2c5acd67b8d13d13ff

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

Signed
1 files changed, +2 -2Showing whitespace changes
public/script.js+2 -2
@@ -3866,7 +3866,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
3866 coreChat = await Promise.all(coreChat.map(async (chatItem, index) => {3866 coreChat = await Promise.all(coreChat.map(async (chatItem, index) => {
3867 let message = chatItem.mes;3867 let message = chatItem.mes;
3868 let regexType = chatItem.is_user ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT;3868 let regexType = chatItem.is_user ? regex_placement.USER_INPUT : regex_placement.AI_OUTPUT;
3869 let options = { isPrompt: true, depth: (coreChat.length - index - (isContinue ? 1 : 0)) };3869 let options = { isPrompt: true, depth: (coreChat.length - index - 1) };
38703870
3871 let regexedMessage = getRegexedString(message, regexType, options);3871 let regexedMessage = getRegexedString(message, regexType, options);
3872 regexedMessage = await appendFileContent(chatItem, regexedMessage);3872 regexedMessage = await appendFileContent(chatItem, regexedMessage);
@@ -3884,7 +3884,7 @@ export async function Generate(type, { automatic_trigger, force_name2, quiet_pro
38843884
3885 const reasoning = new PromptReasoning();3885 const reasoning = new PromptReasoning();
3886 for (let i = coreChat.length - 1; i >= 0; i--) {3886 for (let i = coreChat.length - 1; i >= 0; i--) {
3887 const depth = coreChat.length - i - (isContinue ? 1 : 0);3887 const depth = coreChat.length - i - 1;
3888 const isPrefix = isContinue && i === coreChat.length - 1;3888 const isPrefix = isContinue && i === coreChat.length - 1;
3889 coreChat[i] = {3889 coreChat[i] = {
3890 ...coreChat[i],3890 ...coreChat[i],