fix: address LLM square bracket mapping format and resolve Biome import formatting

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
MythEclipse
2026-05-18 04:40:54 +07:00
co-authored by Claude Opus 4.7
parent cc2c247311
commit 1085d7909c
14 changed files with 46 additions and 24 deletions
+4 -1
View File
@@ -101,7 +101,10 @@ export function parseModerationResponse(
throw new Error("Result missing 'message_id'");
}
let finalId = String(message_id);
let finalId = String(message_id).trim();
if (finalId.startsWith("[") && finalId.endsWith("]")) {
finalId = finalId.slice(1, -1).trim();
}
// Precision loss fix: If the ID from LLM is not found,
// try to find the closest match in targets if it looks rounded (ends in 000)