Second macro evaluation of WI for all positions - The first macro evaluation occurs when the entry is activated. - The second macro evaluation occurs after the regex replacement * and only when the entry is before or after the char definition this may cause confusion for users. I'm not sure if this is the right thing to do, but it's one way I can think of to make all this make more sense.

8edc999854ad09c54e7dbb2ddbcae157d288954b

steve green <steve_green@qq.com>

Signed
1 files changed, +5 -3Showing whitespace changes
public/scripts/world-info.js+5 -3
@@ -4125,7 +4125,9 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) {
41254125 // TODO (kingbri): Change to use WI Anchor positioning instead of separate top/bottom arrays
41264126 [...allActivatedEntries].sort(sortFn).forEach((entry) => {
41274127 const regexDepth = entry.position === world_info_position.atDepth ? (entry.depth ?? DEFAULT_DEPTH) : null;
4128- const content = getRegexedString(entry.content, regex_placement.WORLD_INFO, { depth: regexDepth, isMarkdown: false, isPrompt: true });
4128+ const content = substituteParams(
4129+ getRegexedString(entry.content, regex_placement.WORLD_INFO, { depth: regexDepth, isMarkdown: false, isPrompt: true })
4130+ );
41294131
41304132 if (!content) {
41314133 console.debug(`[WI] Entry ${entry.uid}`, 'skipped adding to prompt due to empty content', entry);
@@ -4134,10 +4136,10 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) {
41344136
41354137 switch (entry.position) {
41364138 case world_info_position.before:
41374139 WIBeforeEntries.unshift(substituteParams(content));
41384140 break;
41394141 case world_info_position.after:
41404142 WIAfterEntries.unshift(substituteParams(content));
41414143 break;
41424144 case world_info_position.EMTop:
41434145 EMEntries.unshift(