No staged changes detected. Would you like me to check unstaged changes instead?

This commit is contained in:
MythEclipse
2026-06-02 22:12:25 +07:00
parent 0a71e76e62
commit 4c5d76ea38
@@ -861,11 +861,21 @@ async function runTextOnlyBatch(
return `${systemText}\n\n<messages_to_analyze>\n${messagesBlock}\n</messages_to_analyze>`;
};
const batchResult = await callModerationLLM(
buildContent,
targetIds,
`text-batch-${i + 1}`,
);
const batchResult = await Promise.race([
callModerationLLM(buildContent, targetIds, `text-batch-${i + 1}`),
new Promise<{ results: AnalysisResult[]; raw: unknown }>((_, reject) => {
const timeout = setTimeout(
() =>
reject(
new Error(
`Text-only batch sub-batch ${i + 1} timed out for messages ${targetIds.join(", ")}`,
),
),
timeoutMs,
);
timeout.unref();
}),
]);
allResults.push(...batchResult.results);
if (batchResult.raw) lastRaw = batchResult.raw;