feat(moderation): two-tier batch+individual fallback pipeline
- After a batch LLM call, any result flagged analysis_incomplete is immediately fanned out to an individual per-message fallback queue - Batch hard-fail (result.ok=false) and unhandled exceptions now also route all affected messages to the individual queue instead of waiting behind the conversation error cooldown - Individual queue runs fully parallel (fire-and-forget per message), de-duplicated by a Set<messageId> so no double-processing - processIndividualFallback runs in the main process (no worker pool IPC overhead for a single-item call), with retryWithBackoff 2x/2-15s - AnalysisQueueStatus gains activeIndividualRequests + individualInFlightCount fields for dashboard observability
This commit is contained in:
@@ -137,5 +137,9 @@ export type ModerationWsEvent =
|
||||
export interface AnalysisQueueStatus {
|
||||
queuedConversations: number;
|
||||
activeRequests: number;
|
||||
/** Number of single-message fallback calls currently awaiting the LLM. */
|
||||
activeIndividualRequests: number;
|
||||
/** Number of message IDs sitting in the dedup set (in-flight or about to start). */
|
||||
individualInFlightCount: number;
|
||||
lastError: string | null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user