fix: updated execute_command to not mangle heredocs and also added explicit instructions to the coder and sisyphus agents to use fs_write and fs_patch over execute_command when writing files

This commit is contained in:
2026-06-03 10:20:39 -06:00
parent 28a283283f
commit aa2d4f3265
3 changed files with 37 additions and 4 deletions
+7 -2
View File
@@ -1,7 +1,7 @@
#!/usr/bin/env bash
set -e
# @describe Execute the shell command.
# @describe Execute the shell command. DO NOT use this to write files — use fs_write (new files) or fs_patch (edits) instead. Shell-based file writes (cat >, echo >, printf >, tee, heredocs, python -c "open(...)") break on multi-line content, special characters, quoted strings, and nested language blocks.
# @option --command! The command to execute.
# @env LLM_OUTPUT=/dev/stdout The output path
@@ -11,6 +11,11 @@ source "$LLM_PROMPT_UTILS_FILE"
main() {
guard_operation
local script
script="$(mktemp)"
# shellcheck disable=SC2064
trap "rm -f '$script'" EXIT
# shellcheck disable=SC2154
eval "$argc_command" >> "$LLM_OUTPUT"
printf '%s\n' "$argc_command" > "$script"
bash "$script" >> "$LLM_OUTPUT"
}