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

Offen
#135 1 Kommentar 0 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

@ryzizub arbeitet bereits daran.

Seit 06.11.2026.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Beschreibung

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

Vorherrschende Sprache
Dart
Sterne
3
Forks
0
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
40

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus VeryGoodOpenSource/vgv_ai_cli

Alle Issues in VeryGoodOpenSource/vgv_ai_cli

Ähnliche Issues

Weitere Issues zu Dart

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.