Skip to content

Commit 77ddc52

Browse files
Nubebusterclaude
andcommitted
test(core): update read-many-files test for byte threshold behavior
Update test to reflect that files under the byte threshold are read in full without automatic line truncation. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 2870df3 commit 77ddc52

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

packages/core/src/tools/read-many-files.test.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -539,9 +539,10 @@ describe('ReadManyFilesTool', () => {
539539
fs.rmSync(tempDir2, { recursive: true, force: true });
540540
});
541541

542-
it('should add a warning for truncated files', async () => {
542+
it('should read files in full when under byte threshold (no automatic line truncation)', async () => {
543543
createFile('file1.txt', 'Content1');
544-
// Create a file that will be "truncated" by making it long
544+
// Create a file with many lines - but still under the byte threshold
545+
// so it will be read in full without truncation
545546
const longContent = Array.from({ length: 2500 }, (_, i) => `L${i}`).join(
546547
'\n',
547548
);
@@ -553,19 +554,20 @@ describe('ReadManyFilesTool', () => {
553554
const content = result.llmContent as string[];
554555

555556
const normalFileContent = content.find((c) => c.includes('file1.txt'));
556-
const truncatedFileContent = content.find((c) =>
557+
const largeFileContent = content.find((c) =>
557558
c.includes('large-file.txt'),
558559
);
559560

561+
// Neither file should have truncation warning since both are under byte threshold
560562
expect(normalFileContent).not.toContain(
561563
'[WARNING: This file was truncated.',
562564
);
563-
expect(truncatedFileContent).toContain(
564-
"[WARNING: This file was truncated. To view the full content, use the 'read_file' tool on this specific file.]",
565+
expect(largeFileContent).not.toContain(
566+
'[WARNING: This file was truncated.',
565567
);
566-
// Check that the actual content is still there but truncated
567-
expect(truncatedFileContent).toContain('L200');
568-
expect(truncatedFileContent).not.toContain('L2400');
568+
// Both early and late content should be present (no truncation)
569+
expect(largeFileContent).toContain('L200');
570+
expect(largeFileContent).toContain('L2400');
569571
});
570572

571573
it('should read files with special characters like [] and () in the path', async () => {

0 commit comments

Comments
 (0)