Prefer stickied WI for budget-limited cases - Instead of processing entries by default sorting (based on order and books (char first, etc)), sticky will now be the first to process. This will make sure that stickied entries will reach the prompt, even in budget-limited scenarios.

a70b5af0c4756e664f8debe135a746cfc594772b

Wolfsblvt <wolfsblvt@gmail.com>

1 files changed, +9 -1Ignore whitespace
public/scripts/world-info.js+9 -1
@@ -3940,8 +3940,16 @@ export async function checkWorldInfo(chat, maxContext, isDryRun) {
3940 }3940 }
39413941
3942 console.debug(`[WI] Search done. Found ${activatedNow.size} possible entries.`);3942 console.debug(`[WI] Search done. Found ${activatedNow.size} possible entries.`);
3943
3944 // Sort the entries for the probability and the budget limit checks
3943 const newEntries = [...activatedNow]3945 const newEntries = [...activatedNow]
3944 .sort((a, b) => sortedEntries.indexOf(a) - sortedEntries.indexOf(b));3946 .sort((a, b) => {
3947 const isASticky = timedEffects.isEffectActive('sticky', a) ? 1 : 0;
3948 const isBSticky = timedEffects.isEffectActive('sticky', b) ? 1 : 0;
3949 return isBSticky - isASticky || sortedEntries.indexOf(a) - sortedEntries.indexOf(b);
3950 });
3951
3952
3945 let newContent = '';3953 let newContent = '';
3946 const textToScanTokens = await getTokenCountAsync(allActivatedText);3954 const textToScanTokens = await getTokenCountAsync(allActivatedText);
39473955