fix(moderation): remove manual reanalyze triggers — auto-recovery only
Manual per-message and batch reanalyze buttons/endpoints let anyone re-queue arbitrary messages for LLM analysis, burning AI credits on spam. Removed: - FE: Reanalyze buttons in message list, search panel, and messages page - FE: useReanalyze/useReanalyzeBatch hooks + messagesApi methods - BE: POST /api/messages/:id/reanalyze and /reanalyze-batch endpoints - BE: markForReanalysis/reanalyzeErrorBatch service+repository methods Recovery of failed messages is fully automatic: the discord-gateway startPendingAIAnalysisWorker retries 'pending' (batch path) and 'error/analysis_incomplete' (individual path) messages on AI_ANALYSIS_RECOVERY_INTERVAL_MS.
This commit is contained in:
@@ -58,15 +58,6 @@ export class MessagesService {
|
||||
return messagesRepository.getImageMessages(guildId, limit);
|
||||
}
|
||||
|
||||
async markForReanalysis(id: string): Promise<void> {
|
||||
if (!id) {
|
||||
throw new ValidationError("message ID is required");
|
||||
}
|
||||
|
||||
logger.debug({ id }, "Marking message for re-analysis");
|
||||
await messagesRepository.markForReanalysis(id);
|
||||
}
|
||||
|
||||
async getReviewMessages(
|
||||
channelId?: string,
|
||||
limit?: number,
|
||||
@@ -74,25 +65,6 @@ export class MessagesService {
|
||||
logger.debug({ channelId, limit }, "Getting review messages");
|
||||
return messagesRepository.getReviewMessages(channelId, limit);
|
||||
}
|
||||
|
||||
async reanalyzeErrorBatch(opts: {
|
||||
guildId?: string;
|
||||
channelId?: string;
|
||||
messageIds?: string[];
|
||||
}) {
|
||||
if (
|
||||
!opts.guildId &&
|
||||
!opts.channelId &&
|
||||
(!opts.messageIds || opts.messageIds.length === 0)
|
||||
) {
|
||||
throw new ValidationError(
|
||||
"At least one of guildId, channelId, or messageIds[] is required",
|
||||
);
|
||||
}
|
||||
|
||||
logger.info(opts, "Batch reanalyzing errored messages");
|
||||
return messagesRepository.reanalyzeErrorBatch(opts);
|
||||
}
|
||||
}
|
||||
|
||||
export const messagesService = new MessagesService();
|
||||
|
||||
Reference in New Issue
Block a user