Merge branch 'staging' into wi-duplicate

This commit is contained in:
LenAnderson
2024-01-09 14:25:09 +00:00
8 changed files with 84 additions and 32 deletions

View File

@@ -1916,6 +1916,11 @@ async function checkWorldInfo(chat, maxContext) {
needsToScan = false;
}
if (newEntries.length === 0) {
console.debug('No new entries activated, stopping');
needsToScan = false;
}
if (needsToScan) {
const text = newEntries
.filter(x => !failedProbabilityChecks.has(x))
@@ -2017,13 +2022,17 @@ function filterByInclusionGroups(newEntries, allActivatedEntries) {
for (const [key, group] of Object.entries(grouped)) {
console.debug(`Checking inclusion group '${key}' with ${group.length} entries`, group);
if (!Array.isArray(group) || group.length <= 1) {
console.debug('Skipping inclusion group check, only one entry');
if (Array.from(allActivatedEntries).some(x => x.group === key)) {
console.debug(`Skipping inclusion group check, group already activated '${key}'`);
// We need to forcefully deactivate all other entries in the group
for (const entry of group) {
newEntries.splice(newEntries.indexOf(entry), 1);
}
continue;
}
if (Array.from(allActivatedEntries).some(x => x.group === key)) {
console.debug(`Skipping inclusion group check, group already activated '${key}'`);
if (!Array.isArray(group) || group.length <= 1) {
console.debug('Skipping inclusion group check, only one entry');
continue;
}