From 871e421ec8a583e3e9ee2abc2b0005a234d068d2 Mon Sep 17 00:00:00 2001 From: Will Hohyon Ryu Date: Thu, 7 Mar 2024 19:01:18 -0800 Subject: [PATCH] feat(ai): Ignore diffs longer than 2000 characters to improve performance --- src/main.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.ts b/src/main.ts index f73ea7f..f971d45 100644 --- a/src/main.ts +++ b/src/main.ts @@ -66,6 +66,9 @@ async function analyzeCode( for (const file of parsedDiff) { if (file.to === "/dev/null") continue; // Ignore deleted files for (const chunk of file.chunks) { + // Ignore diffs longer than 2000 characters + if (chunk.content.length > 2000) continue; + const prompt = createPrompt(file, chunk, prDetails); const aiResponse = await getAIResponse(prompt); if (aiResponse) {