style: fix biome formatting after audit fixes

This commit is contained in:
asepharyana
2026-08-26 18:12:02 +07:00
parent 9f02edd646
commit 709074935f
4 changed files with 20 additions and 9 deletions
@@ -166,7 +166,9 @@ export function startPendingAIAnalysisWorker(
// Only revert stuck processing messages if there's active processing. // Only revert stuck processing messages if there's active processing.
// Avoids a DB query every recovery interval when the pipeline is idle. // Avoids a DB query every recovery interval when the pipeline is idle.
if (conversationProcessing.size > 0) { if (conversationProcessing.size > 0) {
messageStore.revertStuckProcessingMessages(300000).catch((err: unknown) => { messageStore
.revertStuckProcessingMessages(300000)
.catch((err: unknown) => {
logger.error( logger.error(
{ error: String(err) }, { error: String(err) },
"Failed to run stuck processing recovery", "Failed to run stuck processing recovery",
@@ -146,7 +146,11 @@ function isAlreadyDeletedError(error: unknown): boolean {
return true; return true;
// Fallback: check the message text for the Discord "Unknown Message" string // Fallback: check the message text for the Discord "Unknown Message" string
const msg = const msg =
error instanceof Error ? error.message : typeof error === "string" ? error : ""; error instanceof Error
? error.message
: typeof error === "string"
? error
: "";
return msg.includes("Unknown Message") || msg.includes("Unknown Channel"); return msg.includes("Unknown Message") || msg.includes("Unknown Channel");
} }
@@ -80,7 +80,8 @@ export async function callModerationLLM(
]; ];
const completion = await llmChat({ const completion = await llmChat({
messages, messages,
max_tokens: maxTokens ?? config.AI_LLM_MAX_COMPLETION_TOKENS ?? 16384, max_tokens:
maxTokens ?? config.AI_LLM_MAX_COMPLETION_TOKENS ?? 16384,
jsonResponse: { type: "json_object" }, jsonResponse: { type: "json_object" },
retries: 0, retries: 0,
signal, signal,
@@ -197,7 +197,11 @@ export const configSchema = z
.positive() .positive()
.default(1024), .default(1024),
AI_LLM_TEXT_BATCH_SIZE: z.coerce.number().int().positive().default(60), AI_LLM_TEXT_BATCH_SIZE: z.coerce.number().int().positive().default(60),
AI_LLM_MAX_COMPLETION_TOKENS: z.coerce.number().int().positive().default(16384), AI_LLM_MAX_COMPLETION_TOKENS: z.coerce
.number()
.int()
.positive()
.default(16384),
AI_LLM_MEDIA_ANALYSIS_TIMEOUT_MS: z.coerce AI_LLM_MEDIA_ANALYSIS_TIMEOUT_MS: z.coerce
.number() .number()
.int() .int()