Fix build.

This commit is contained in:
Christian Gunderman
2026-02-17 22:01:44 -08:00
parent 8cb2bfe995
commit 7091cef045
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -928,7 +928,7 @@ class EditToolInvocation
: `Successfully modified file: ${this.params.file_path} (${editData.occurrences} replacements).`, : `Successfully modified file: ${this.params.file_path} (${editData.occurrences} replacements).`,
]; ];
const snippet = getDiffContextSnippet( const snippet = getDiffContextSnippet(
originalContent, editData.currentContent ?? '',
finalContent, finalContent,
5, 5,
); );
+5 -5
View File
@@ -161,7 +161,6 @@ export interface RipGrepToolParams {
interface GrepMatch { interface GrepMatch {
filePath: string; filePath: string;
absolutePath: string; absolutePath: string;
absolutePath: string;
lineNumber: number; lineNumber: number;
line: string; line: string;
isContext?: boolean; isContext?: boolean;
@@ -329,11 +328,10 @@ class GrepToolInvocation extends BaseToolInvocation<
fileMatches[0].absolutePath, fileMatches[0].absolutePath,
'utf8', 'utf8',
); );
fileLines = content.split(/ fileLines = content.split(/\r?\n/);
?
} catch (err) { } catch (err) {
debugLogger.warn( debugLogger.warn(
debugLogger.warn( `Failed to read file for context: ${fileMatches[0].absolutePath}`,
err, err,
); );
} }
@@ -358,7 +356,9 @@ class GrepToolInvocation extends BaseToolInvocation<
}); });
seenLines.add(i + 1); seenLines.add(i + 1);
} else if (i + 1 === match.lineNumber) { } else if (i + 1 === match.lineNumber) {
} else if (i + 1 === match.lineNumber) { const index = newFileMatches.findIndex(
(m) => m.lineNumber === i + 1,
);
if (index !== -1) { if (index !== -1) {
newFileMatches[index].isContext = false; newFileMatches[index].isContext = false;
} }