summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/read-many-files.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/tools/read-many-files.ts')
-rw-r--r--packages/core/src/tools/read-many-files.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/packages/core/src/tools/read-many-files.ts b/packages/core/src/tools/read-many-files.ts
index 1fa2e15c..a380ea91 100644
--- a/packages/core/src/tools/read-many-files.ts
+++ b/packages/core/src/tools/read-many-files.ts
@@ -524,11 +524,15 @@ Use this tool when the user's query implies needing the content of several files
'{filePath}',
filePath,
);
- contentParts.push(
- `${separator}\n\n${fileReadResult.llmContent}\n\n`,
- );
+ let fileContentForLlm = '';
+ if (fileReadResult.isTruncated) {
+ fileContentForLlm += `[WARNING: This file was truncated. To view the full content, use the 'read_file' tool on this specific file.]\n\n`;
+ }
+ fileContentForLlm += fileReadResult.llmContent;
+ contentParts.push(`${separator}\n\n${fileContentForLlm}\n\n`);
} else {
- contentParts.push(fileReadResult.llmContent); // This is a Part for image/pdf
+ // This is a Part for image/pdf, which we don't add the separator to.
+ contentParts.push(fileReadResult.llmContent);
}
processedFilesRelativePaths.push(relativePathForDisplay);