Skip to content

Built-in functions.view returns no content for large files despite documenting automatic truncation #5476

Backlog

Description

@aaroneng

Describe the bug

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

  1. 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")'
  2. In Copilot CLI, ask:
    Use the built-in view tool to read view-size-repro.md.
    For this test, omit view_range and forceReadLargeFiles.
  3. 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.
  4. 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

Additional context

No response

Activity

  1. added theissue type on Nov 16, 2026
  2. added
    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior
    and removed on Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:toolsBuilt-in tools: file editing, shell, search, LSP, git, and tool call behavior

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions