mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-08 20:30:53 -07:00
Fixed @ file content not being added or sent to server (#962)
This commit is contained in:
@@ -154,9 +154,7 @@ describe('handleAtCommand', () => {
|
||||
const query = `@${filePath}`;
|
||||
const fileContent = 'This is the file content.';
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${filePath} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${filePath} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read 1 file.',
|
||||
});
|
||||
|
||||
@@ -202,9 +200,7 @@ ${fileContent}`,
|
||||
isDirectory: () => true,
|
||||
} as Stats);
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${resolvedGlob} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${resolvedGlob} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read directory contents.',
|
||||
});
|
||||
|
||||
@@ -245,9 +241,7 @@ ${fileContent}`,
|
||||
// Current implementation of read_many_files for images returns base64 in text.
|
||||
const imageFileTextContent = '[base64 image data for path/to/image.png]';
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${imagePath} ---
|
||||
${imageFileTextContent}`,
|
||||
llmContent: [`--- ${imagePath} ---\n\n${imageFileTextContent}\n\n`],
|
||||
returnDisplay: 'Read 1 image.',
|
||||
});
|
||||
|
||||
@@ -276,9 +270,7 @@ ${imageFileTextContent}`,
|
||||
const query = `${textBefore}@${filePath}${textAfter}`;
|
||||
const fileContent = 'Markdown content.';
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${filePath} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${filePath} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read 1 doc.',
|
||||
});
|
||||
|
||||
@@ -310,9 +302,7 @@ ${fileContent}`,
|
||||
const query = `@${rawPath}`;
|
||||
const fileContent = 'Content of file with space.';
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${unescapedPath} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${unescapedPath} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read 1 file.',
|
||||
});
|
||||
|
||||
@@ -338,11 +328,10 @@ ${fileContent}`,
|
||||
const query = `@${file1} @${file2}`;
|
||||
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${file1} ---
|
||||
${content1}
|
||||
--- ${file2} ---
|
||||
${content2}`,
|
||||
llmContent: [
|
||||
`--- ${file1} ---\n\n${content1}\n\n`,
|
||||
`--- ${file2} ---\n\n${content2}\n\n`,
|
||||
],
|
||||
returnDisplay: 'Read 2 files.',
|
||||
});
|
||||
|
||||
@@ -381,11 +370,10 @@ ${content2}`,
|
||||
const query = `${text1}@${file1}${text2}@${file2}${text3}`;
|
||||
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${file1} ---
|
||||
${content1}
|
||||
--- ${file2} ---
|
||||
${content2}`,
|
||||
llmContent: [
|
||||
`--- ${file1} ---\n\n${content1}\n\n`,
|
||||
`--- ${file2} ---\n\n${content2}\n\n`,
|
||||
],
|
||||
returnDisplay: 'Read 2 files.',
|
||||
});
|
||||
|
||||
@@ -446,11 +434,10 @@ ${content2}`,
|
||||
});
|
||||
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${file1} ---
|
||||
${content1}
|
||||
--- ${resolvedFile2} ---
|
||||
${content2}`,
|
||||
llmContent: [
|
||||
`--- ${file1} ---\n\n${content1}\n\n`,
|
||||
`--- ${resolvedFile2} ---\n\n${content2}\n\n`,
|
||||
],
|
||||
returnDisplay: 'Read 2 files.',
|
||||
});
|
||||
|
||||
@@ -537,9 +524,7 @@ ${content2}`,
|
||||
});
|
||||
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${queryPath} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${queryPath} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read 1 file.',
|
||||
});
|
||||
|
||||
@@ -628,9 +613,7 @@ ${fileContent}`,
|
||||
|
||||
mockFileDiscoveryService.shouldIgnoreFile.mockReturnValue(false);
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${validFile} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${validFile} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read 1 file.',
|
||||
});
|
||||
|
||||
@@ -670,9 +653,7 @@ ${fileContent}`,
|
||||
(path: string) => path === gitIgnoredFile,
|
||||
);
|
||||
mockReadManyFilesExecute.mockResolvedValue({
|
||||
llmContent: `
|
||||
--- ${validFile} ---
|
||||
${fileContent}`,
|
||||
llmContent: [`--- ${validFile} ---\n\n${fileContent}\n\n`],
|
||||
returnDisplay: 'Read 1 file.',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user