From 8f4046c71af6c39711761b69e8ea0bf1aeaab8ff Mon Sep 17 00:00:00 2001 From: Colt McAnlis Date: Mon, 7 Jul 2025 10:28:56 -0700 Subject: fix: EditTool can clobber human edits to the same file. (#3043) Co-authored-by: Colt McAnlis Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- packages/core/src/tools/write-file.test.ts | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'packages/core/src/tools/write-file.test.ts') diff --git a/packages/core/src/tools/write-file.test.ts b/packages/core/src/tools/write-file.test.ts index 3f9825c6..c33b5fa2 100644 --- a/packages/core/src/tools/write-file.test.ts +++ b/packages/core/src/tools/write-file.test.ts @@ -114,6 +114,7 @@ describe('WriteFileTool', () => { // Default mock implementations that return valid structures mockEnsureCorrectEdit.mockImplementation( async ( + filePath: string, _currentContent: string, params: EditToolParams, _client: GeminiClient, @@ -248,6 +249,7 @@ describe('WriteFileTool', () => { ); expect(mockEnsureCorrectEdit).toHaveBeenCalledWith( + filePath, originalContent, { old_string: originalContent, @@ -388,6 +390,7 @@ describe('WriteFileTool', () => { )) as ToolEditConfirmationDetails; expect(mockEnsureCorrectEdit).toHaveBeenCalledWith( + filePath, originalContent, { old_string: originalContent, @@ -523,6 +526,7 @@ describe('WriteFileTool', () => { const result = await tool.execute(params, abortSignal); expect(mockEnsureCorrectEdit).toHaveBeenCalledWith( + filePath, initialContent, { old_string: initialContent, -- cgit v1.2.3