You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Built-in functions.view returns no content for large files despite documenting automatic truncation #5476
The built-in functions.view tool’s description says text files larger than 20KB are truncated. However, reading a larger file without view_range returns only a size-limit message, with no file content.
The exact text from the tool description is:
View files, images, or directories.
Images return base64 data and MIME type.
Text files return their content.
Directories list non-hidden entries up to 2 levels deep.
path must be absolute.
Files over 20KB are truncated; use view_range for sections.
Thus, it's expected that just calling view for a text file larger than 20KB would return a truncated version of that content at 20KB.
Affected version
1.0.112
Steps to reproduce the behavior
Create a synthetic 26,400-byte, 800-line text file:
python3 -c 'from pathlib import Path; Path("view-size-repro.md").write_text("0123456789abcdef0123456789abcdef\n" * 800, encoding="utf-8")'
In Copilot CLI, ask:
Use the built-in view tool to read view-size-repro.md.
For this test, omit view_range and forceReadLargeFiles.
Observe that the tool returns only:
File too large to read at once (25.8 KB). Consider using the rg tool to search within the file, or view with view_range to read specific sections.
Ask it to read the same file with view_range: [1,5]. The five lines are returned successfully.
Expected behavior
functions.view behavior should match the tool description, whether that means adjusting the tool description or the tool behavior
Activity