feat(devin): run the edit hooks on apply_patch edits

Ouverte
#135 1 commentaire 0 réactions 1 personne assignée Voir sur GitHub

Les mainteneurs répondent en général sous 1 jour

@ryzizub y travaille déjà.

Depuis le 6/11/2026.

Évaluation

Cette issue n'a pas encore été évaluée.

Description

feature

Description

Under Devin, a GPT model with the Codex tools setting edits files through apply_patch rather than edit and write. DevinTranslator names apply_patch in the edit matcher, so the hook fires, but apply_patch is a freeform tool: the model emits the patch text directly instead of JSON, so the payload carries no file_path. analyze.sh and format.sh read .tool_input.file_path, find nothing and exit 0. Dart files edited that way are never analyzed or formatted, and nothing says so at runtime.

The compat script can close this the way codex_compat.dart and copilot_compat.dart already do: fan out per file. The grammar is in the Devin binary, and it is the same envelope Copilot's fan-out already parses:

begin_patch: "*** Begin Patch" LF
add_hunk:    "*** Add File: " filename LF add_line+
delete_hunk: "*** Delete File: " filename LF
update_hunk: "*** Update File: " filename LF change_move? change?
change_move: "*** Move to: " filename LF

Its tool prompt also says "You MUST always use the absolute path when specifying the target file", so no working directory is needed — which matters, because a Devin hook payload carries no cwd.

Requirements

  • devinCompatScript re-runs the hook script once per file named by an *** Add File:, *** Update File: or *** Move to: header, with tool_name set to Write for an added file and Edit otherwise, and tool_input.file_path set to that path
  • Accept the patch text whether it arrives as a bare tool_input string or inside an object, since which one Devin sends has not been captured yet
  • Fall through to current behaviour when the payload matches neither, so a wrong guess cannot regress anything
  • Tests pin both payload shapes

Additional Context

Found while verifying #81. The real-session test on #95 confirmed the edit, write and exec payloads but could not reach apply_patch: the default model has no such tool, and the GPT models that do are behind a Pro plan.

To capture the real payload, someone on Pro can run devin -p "<prompt asking for an apply_patch edit of a .dart file>" --model gpt-6-astra-low against the installed config and log the stdin of a PostToolUse hook matching .*.

Langage dominant
Dart
Étoiles
3
Forks
0
Merge moyen
2 j 4 h
PR mergées (30 j)
40

Préparer son environnement

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de VeryGoodOpenSource/vgv_ai_cli

Toutes les issues de VeryGoodOpenSource/vgv_ai_cli

Issues similaires

Plus d'issues Dart

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.