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

View File

@@ -928,7 +928,7 @@ class EditToolInvocation
: `Successfully modified file: ${this.params.file_path} (${editData.occurrences} replacements).`,
];
const snippet = getDiffContextSnippet(
originalContent,
editData.currentContent ?? '',
finalContent,
5,
);

View File

@@ -161,7 +161,6 @@ export interface RipGrepToolParams {
interface GrepMatch {
filePath: string;
absolutePath: string;
absolutePath: string;
lineNumber: number;
line: string;
isContext?: boolean;
@@ -329,11 +328,10 @@ class GrepToolInvocation extends BaseToolInvocation<
fileMatches[0].absolutePath,
'utf8',
);
fileLines = content.split(/
?
fileLines = content.split(/\r?\n/);
} catch (err) {
debugLogger.warn(
debugLogger.warn(
`Failed to read file for context: ${fileMatches[0].absolutePath}`,
err,
);
}
@@ -358,7 +356,9 @@ class GrepToolInvocation extends BaseToolInvocation<
});
seenLines.add(i + 1);
} else if (i + 1 === match.lineNumber) {
} else if (i + 1 === match.lineNumber) {
const index = newFileMatches.findIndex(
(m) => m.lineNumber === i + 1,
);
if (index !== -1) {
newFileMatches[index].isContext = false;
}