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

Aperta
#135 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@ryzizub ci sta già lavorando.

Dal 6/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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 .*.

Lingua principale
Dart
Stelle
3
Fork
0
Merge medio
2g 4h
PR unite (30g)
40

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di VeryGoodOpenSource/vgv_ai_cli

Tutte le issue di VeryGoodOpenSource/vgv_ai_cli

Issue simili

Altre issue su Dart

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.