From 9287cb731964e57cc4757b24ee3edc3bfdcf3011 Mon Sep 17 00:00:00 2001 From: MythEclipse Date: Sat, 6 Jun 2026 17:18:41 +0700 Subject: [PATCH] =?UTF-8?q?fix(ai-moderation):=20guard=20against=20stale?= =?UTF-8?q?=20empty=20imageUrl=20rows=20from=20base64=E2=86=92URL=20migrat?= =?UTF-8?q?ion?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/modules/ai-moderation/llmModerationClient.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/discord-gateway/src/modules/ai-moderation/llmModerationClient.ts b/services/discord-gateway/src/modules/ai-moderation/llmModerationClient.ts index fa2f0e2..e066ad9 100644 --- a/services/discord-gateway/src/modules/ai-moderation/llmModerationClient.ts +++ b/services/discord-gateway/src/modules/ai-moderation/llmModerationClient.ts @@ -1546,7 +1546,10 @@ async function _runSingleMediaAnalysis( if (candidate.stickerName && isStickerCacheReady()) { try { const cached = await getStickerFromCache(candidate.stickerName); - if (cached) { + // Guard against stale rows that survived the base64→URL migration + // (DEFAULT '' image_url). An empty URL would cause the vision API + // to reject the request with "multi_modal_data['image'][0] is empty". + if (cached && cached.imageUrl) { const part: MessageImagePart = { type: "image_url", // imageUrl is already a remote URL — faster than re-uploading