improve read-many-files output (#596)

This commit is contained in:
Seth Troisi 2025-05-29 14:03:24 -07:00 committed by GitHub
parent dc94a03f39
commit 4b4ba85313
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View File

@ -293,9 +293,7 @@ describe('ReadManyFilesTool', () => {
(c) => typeof c === 'string' && c.includes('--- notes.txt ---'),
),
).toBe(true);
expect(result.returnDisplay).toContain(
'**Skipped 1 item(s) (up to 5 shown):**',
);
expect(result.returnDisplay).toContain('**Skipped 1 item(s):**');
expect(result.returnDisplay).toContain(
'- `document.pdf` (Reason: asset file (image/pdf) was not explicitly requested by name or extension)',
);

View File

@ -402,7 +402,11 @@ Use this tool when the user's query implies needing the content of several files
if (processedFilesRelativePaths.length === 0) {
displayMessage += `No files were read and concatenated based on the criteria.\n`;
}
displayMessage += `\n**Skipped ${skippedFiles.length} item(s) (up to 5 shown):**\n`;
if (skippedFiles.length <= 5) {
displayMessage += `\n**Skipped ${skippedFiles.length} item(s):**\n`;
} else {
displayMessage += `\n**Skipped ${skippedFiles.length} item(s) (first 5 shown):**\n`;
}
skippedFiles
.slice(0, 5)
.forEach(