Repository navigation
fix: 大きな差分でも全ファイルの変更概要をAIに渡す - #4
Merged
Merged
Conversation
差分の先頭で文字数の上限を使い切ると、後続ファイルがプロンプトから消えていた。 全ファイルの名前と追加・削除行数を保持し、本文をファイルごとに配分する。 省略・短縮したファイル数を示し、小さな差分の出力と本文の除外設定を維持する。 複数コミットの生成では結合後に一度だけ処理し、生成ログも一覧から件数を取得する。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
概要
差分の先頭だけで上限に達すると、後続ファイルの名前も変更行数もAIに渡らず、コミットの一部だけを説明するメッセージが生成されていました。大きな差分では全ファイルの一覧と追加・削除行数を残し、本文をファイルごとに配分します。
原因と変更
全体を先頭から切り詰めていたため、パス順で前にあるファイルが文字数の枠を使い切っていました。全ファイルの一覧を本文の予算とは別に保持し、本文を省略・短縮したファイル数を明記します。一覧だけで上限を超えても全件を伝えるためです。小さな差分の出力は維持します。Apple Intelligence が端末のコンテキスト上限へ合わせて行う最終縮約は既存の制約に従います。
複数コミットの
--generate-forは差分を結合してから一度だけ処理し、再切り詰めによる一覧の欠落を防ぎます。除外対象・lockファイル・バイナリの本文を送らない方針を維持し、生成ログのファイル件数も一覧に合わせます。検証
make ci: 成功(整形、Clippyの両構成、ユニット1,208件、統合76件)。astro-sight review/impact、差分検査、独立レビューを実施。Closes #3