From a08b4ae3114ff18f65996b143607bd50f660472d Mon Sep 17 00:00:00 2001 From: Jacob Kim Date: Fri, 18 Jul 2025 20:59:04 -0700 Subject: [PATCH] chore: test around with rerank --- core/nextEdit/NextEditEditableRegionCarver.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/nextEdit/NextEditEditableRegionCarver.ts b/core/nextEdit/NextEditEditableRegionCarver.ts index 69a6708e7..d6c831923 100644 --- a/core/nextEdit/NextEditEditableRegionCarver.ts +++ b/core/nextEdit/NextEditEditableRegionCarver.ts @@ -96,7 +96,11 @@ async function rerankJump(ctx: { (a, b) => scores[chunks.indexOf(b)] - scores[chunks.indexOf(a)], ); - const mostRelevantChunk = chunks[0]; + // const mostRelevantChunk = chunks[0]; + // Get the third most relevant chunk if there are enough chunks, + // otherwise fallback to second or first. + const chunkIndex = Math.min(2, chunks.length - 1); + const mostRelevantChunk = chunks[chunkIndex]; // Return the range of the most relevant chunk. // NOTE: It might be better to return a list of chunks,