fix(ai-moderation): guard against stale empty imageUrl rows from base64→URL migration
This commit is contained in:
@@ -1546,7 +1546,10 @@ async function _runSingleMediaAnalysis(
|
|||||||
if (candidate.stickerName && isStickerCacheReady()) {
|
if (candidate.stickerName && isStickerCacheReady()) {
|
||||||
try {
|
try {
|
||||||
const cached = await getStickerFromCache(candidate.stickerName);
|
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 = {
|
const part: MessageImagePart = {
|
||||||
type: "image_url",
|
type: "image_url",
|
||||||
// imageUrl is already a remote URL — faster than re-uploading
|
// imageUrl is already a remote URL — faster than re-uploading
|
||||||
|
|||||||
Reference in New Issue
Block a user