From f32d72a3f2b889fdc56b445aef108b0b869b834e Mon Sep 17 00:00:00 2001 From: Alex Clarke Date: Tue, 14 Jul 2026 11:31:11 -0600 Subject: [PATCH] feat: Made fs_patch more flexible for different model preferences of patch formats --- assets/functions/utils/prompt-utils.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/assets/functions/utils/prompt-utils.sh b/assets/functions/utils/prompt-utils.sh index b00f738..85137c9 100755 --- a/assets/functions/utils/prompt-utils.sh +++ b/assets/functions/utils/prompt-utils.sh @@ -552,7 +552,7 @@ patch_file() { continue } - if (line ~ /^@@ /) { + if (line ~ /^@@/) { mode = "hunk" hunkIndex++ patchLineIndex++ @@ -585,6 +585,10 @@ patch_file() { if (hunkIndex == 0) { print "error: no patch" > "/dev/stderr" + print "" > "/dev/stderr" + print "No hunk header was found. Each hunk must start with a line beginning \"@@\"" > "/dev/stderr" + print "(for example \"@@ ... @@\" or \"@@ -1,4 +1,4 @@\"). Inside a hunk, context lines" > "/dev/stderr" + print "start with a single space, removed lines with \"-\", and added lines with \"+\"." > "/dev/stderr" exit 1 }