apply_patch rejects a patch with several hunks for the same file

Abierto
#6 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
62/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
cli, python
Área
cli, tooling

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Sin datos de lenguaje
Estrellas
13
Forks
1
Merge medio
35 min
PR fusionados (30 d)
1

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de databricks/genie-code-cli

Todos los issues de databricks/genie-code-cli

Issues similares

Más issues de CLI

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.