mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-13 23:51:16 -07:00
feat(core): Include file content in write_file tool response for immediate verification
This commit is contained in:
@@ -831,6 +831,20 @@ describe('WriteFileTool', () => {
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
it('should include the file content in llmContent', async () => {
|
||||
const filePath = path.join(rootDir, 'content_check.txt');
|
||||
const content = 'This is the content that should be returned.';
|
||||
mockEnsureCorrectFileContent.mockResolvedValue(content);
|
||||
|
||||
const params = { file_path: filePath, content };
|
||||
const invocation = tool.build(params);
|
||||
|
||||
const result = await invocation.execute(abortSignal);
|
||||
|
||||
expect(result.llmContent).toContain('Here is the updated code:');
|
||||
expect(result.llmContent).toContain(content);
|
||||
});
|
||||
});
|
||||
|
||||
describe('workspace boundary validation', () => {
|
||||
|
||||
@@ -356,6 +356,8 @@ class WriteFileToolInvocation extends BaseToolInvocation<
|
||||
);
|
||||
}
|
||||
|
||||
llmSuccessMessageParts.push(`Here is the updated code:\n${finalContent}`);
|
||||
|
||||
// Log file operation for telemetry (without diff_stat to avoid double-counting)
|
||||
const mimetype = getSpecificMimeType(this.resolvedPath);
|
||||
const programmingLanguage = getLanguageFromFilePath(this.resolvedPath);
|
||||
|
||||
Reference in New Issue
Block a user