feat(moderation): skip AI analysis for music bots via AI_SKIP_ANALYSIS_USER_IDS

Jockie Music (user 411916947773587456) posts now-playing embeds/spotify links
~1347 captured messages — every one consumed a moderation LLM call for zero
signal and contributed to batch timeouts. Config AI_SKIP_ANALYSIS_USER_IDS
(default=Jockie) skips them at ALL three analysis paths:
- queueMessageAnalysis entry (direct skip-result like age-restricted)
- batchScheduler processing (pre-batch filter)
- individual recovery path (no fallback spam for already-skipped authors)

Skip-result mirrors age_restricted: status=clean, flags=[skip_analysis_user],
action=none — stays visible in the dashboard, never analyzed.
This commit is contained in:
asepharyana committed 2026-09-09 23:38:32 +07:00
1 parent db4e84f057
commit 023217b260
4 files changed
+93 -3

No files matched your search

@@ -6,6 +6,7 @@ import {
pickBatchWithinBudget,
processBatch,
skipAgeRestrictedMessages,
skipAnalysisUserMessages,
} from "./batchProcessor.js";
import {
conversationConsecutiveErrors,
@@ -81,7 +82,9 @@ export function scheduleConversationAnalysis(conversationKey: string): void {
return;
}
const processableMessages = await skipAgeRestrictedMessages(messages);
const processableMessages = await skipAnalysisUserMessages(
await skipAgeRestrictedMessages(messages),
);
if (processableMessages.length === 0) {
if (
conversationProcessing.get(conversationKey) === processingStartedAt