From 895bb9ac037c55ef6822950bc292b6168c282234 Mon Sep 17 00:00:00 2001 From: Jules YZERD Date: Tue, 16 Jun 2026 00:20:08 +0200 Subject: [PATCH] fix(ralph-wiggum): guard PROMPT_PARTS expansion against set -u on bash 3.x MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The script uses set -euo pipefail (line 6). On bash 3.x (the default on macOS, which ships bash 3.2 due to the GPL license change), expanding an empty array with ${array[*]} triggers the nounset (-u) error: "unbound variable" This means running /ralph-loop --max-iterations 10 with no positional prompt arguments crashes before the friendly empty-prompt validation message at line 116, showing a confusing shell error instead. Fix: use ${PROMPT_PARTS[*]:-} — the :- default operator makes the expansion safe on both bash 3.x and 4.x when the array is empty. Co-Authored-By: Claude Sonnet 4.6 --- plugins/ralph-wiggum/scripts/setup-ralph-loop.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ralph-wiggum/scripts/setup-ralph-loop.sh b/plugins/ralph-wiggum/scripts/setup-ralph-loop.sh index ac5491f4b8..c444335484 100755 --- a/plugins/ralph-wiggum/scripts/setup-ralph-loop.sh +++ b/plugins/ralph-wiggum/scripts/setup-ralph-loop.sh @@ -110,7 +110,7 @@ HELP_EOF done # Join all prompt parts with spaces -PROMPT="${PROMPT_PARTS[*]}" +PROMPT="${PROMPT_PARTS[*]:-}" # Validate prompt is non-empty if [[ -z "$PROMPT" ]]; then