apply_patch rejects a patch with several hunks for the same file

オープン
#6 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
62/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
cli, python
領域
cli, tooling

調査の方向性

Start by locating the apply_patch implementation and its patch validation path, then reproduce the reported failure with two hunks targeting one file. Check whether the parser rejects repeated file operations and whether the tool description documents the supported patch shape. Done when the tool accepts the patch or its description clearly guides the model to a valid patch, with a regression check for the reported case.

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

説明

Release version

v0.3.0

What happened?

The agent's apply_patch tool call is rejected when one patch contains more than one hunk for the same file. The error is:

apply_patch verification failed: invalid patch: multiple operations target <file>

The agent recovers by retrying with separate patches, but each failure costs a turn and tokens. I saw this 3 times across two sessions, each time while the agent edited a single Python file.

Expected: the tool accepts several hunks for one file in one patch. If that is not supported, the tool description should tell the model to group all hunks for a file under one file operation, so the model does not produce the rejected shape.

Steps to reproduce
  1. Start genie exec in a project with a Python file of a few hundred lines.
  2. Ask for two separate edits in different parts of that file in one request.
  3. If the model emits one patch with two operations on the same file, the call fails with the error above.
Environment

macOS (Apple silicon), Genie Code CLI installed with install.sh, Unity Gateway model provider.

主要言語
言語のデータがありません
スター
13
フォーク
1
平均マージ
35分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

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

databricks/genie-code-cli のほかの issue

databricks/genie-code-cli の issue をすべて見る

似ている issue

CLI の issue をもっと見る

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

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