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

オープン 初心者向け
#5,476 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
72/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
cli, tooling

調査の方向性

issue では組み込みの functions.view ツールが特定されており、view_range を指定せずに 26,400 バイトのテキストファイルを使う再現可能なケースが示されています。まずツールの実装と説明を見つけ、大きなファイルへの応答を、ドキュメントに記載された切り詰め動作と比較してください。動作と説明が一致すれば完了です。ケースを再現し、view_range の例が引き続き動作することを確認してください。

索引モデルが issue の本文から書いたものです。

説明

area:tools
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

主要言語
Python
スター
11.5k
フォーク
2k
平均マージ
6時間 34分
マージ済み PR(30日)
3

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

github/copilot-cli のほかの issue

github/copilot-cli の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。