adding comments

dac5f6910c9a4e3fda00dcac856b229deff3cba4

qvink <qvink@users.noreply.github.com>

3 files changed, +5 -4Ignore whitespace
public/script.js+1 -2
@@ -5295,14 +5295,13 @@ export function getBiasStrings(textareaText, type) {
52955295 * @param {boolean} isInstruct Whether instruct mode is enabled.
52965296 * @param {boolean|number} forceOutputSequence Whether to force the first/last output sequence for instruct mode.
52975297 */
5298-
52995298function formatMessageHistoryItem(chatItem, isInstruct, forceOutputSequence) {
53005299 const isNarratorType = chatItem?.extra?.type === system_message_types.NARRATOR;
53015300 const characterName = chatItem?.name ? chatItem.name : name2;
53025301 const itemName = chatItem.is_user ? chatItem['name'] : characterName;
53035302 const shouldPrependName = !isNarratorType;
53045303
53055304 // If this symbol flag is set, completely ignore the message.
53065305 // This can be used to hide messages without affecting the number of messages in the chat.
53075306 if (chatItem.extra?.[IGNORE_SYMBOL]) {
53085307 return '';
public/scripts/constants.js+2 -1
@@ -17,6 +17,7 @@ export const debounce_timeout = {
1717
1818/*
1919Used as an ephemeral key in message extra metadata.
2020When set, the message will be excluded from context.generation prompts without affecting the number of chat messages,
21+ which is needed to preserve world info timed effects.
2122 */
2223export const IGNORE_SYMBOL = Symbol.for('ignore');
public/scripts/openai.js+2 -1
@@ -528,7 +528,8 @@ function setOpenAIMessages(chat) {
528528 let role = chat[j]['is_user'] ? 'user' : 'assistant';
529529 let content = chat[j]['mes'];
530530
531531 // If this flag is set, completely ignore the message.
532+ // This can be used to hide messages without affecting the number of messages in the chat.
532533 if (chat[j].extra?.[IGNORE_SYMBOL]) {
533534 j++;
534535 continue;