[BUG] search_files hides matching text on long lines

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

メンテナーはふだん 3 日以内に返信

@DananjayaNadun がすでに取り組んでいます。

2026年11月20日 から。

評価

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

調査の方向性

search_files ツールのハンドラーと、各行を500文字のプレビュー上限まで切り詰めて [truncated...] を追加するスニペット生成コードから確認してください。issue にある node -e コマンドで sample.txt を作成し、同じ search_files の引数を指定して実行してください。長い行が一致箇所の前後を含むように切り出され、プレビューが通常のサイズ内に収まり、TARGET が表示されることを確認してください。プレビュー上限を超えた位置での一致を対象にしたテストを追加してください。

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

説明

Problem

search_files can report a match and omit the matching text from the preview.

Context

This affects searches in files with long lines, including minified JavaScript. The agent receives a file name and line number but cannot see the code that matched.

Reproduction steps
  1. Open an empty workspace in VS Code with Zoo Code installed.

  2. Run this command in the workspace terminal to create a one-line file:

    node -e "require('node:fs').writeFileSync('sample.txt', 'a'.repeat(600) + 'TARGET')"
    
  3. Ask Zoo Code to use search_files with these arguments:

    { "path": ".", "regex": "TARGET", "file_pattern": "sample.txt" }
    
  4. Inspect line 1 in the tool result.

Expected result

The preview shows TARGET on line 1 and stays within the usual preview size.

Actual result

The tool reports Found 1 result. It shows the first 500 a characters and [truncated...] on line 1. The preview omits TARGET. The chat display and the tool result sent to the provider show the same text.

App version

Zoo Code 3.98.0, VS Code 1.146.0 (x64), Windows. Reproduced with a local OpenAI-compatible test provider.

主要言語
TypeScript
スター
2k
フォーク
301
平均マージ
3日 14時間
マージ済み PR(30日)
103

環境構築

はじめの一歩

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

Zoo-Code-Org/Zoo-Code のほかの issue

Zoo-Code-Org/Zoo-Code の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

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

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