Skip to content

fix: handle unbound PROMPT_PARTS array in ralph-wiggum setup#29668

Open
sparrowfm wants to merge 1 commit intoanthropics:mainfrom
sparrowfm:fix/ralph-wiggum-unbound-array
Open

fix: handle unbound PROMPT_PARTS array in ralph-wiggum setup#29668
sparrowfm wants to merge 1 commit intoanthropics:mainfrom
sparrowfm:fix/ralph-wiggum-unbound-array

Conversation

@sparrowfm
Copy link

Summary

  • Fixes unbound variable crash in setup-ralph-loop.sh when invoking /ralph-loop
  • The script uses set -u (nounset), which causes ${PROMPT_PARTS[*]} to error when the array is empty
  • Uses ${PROMPT_PARTS[*]+${PROMPT_PARTS[*]}} syntax for safe expansion under set -u

Test plan

  • Run /ralph-loop "test prompt" --max-iterations 2 --completion-promise "DONE" — activates successfully
  • Run /cancel-ralph — cancels cleanly
  • Previously crashed with: PROMPT_PARTS[*]: unbound variable

🤖 Generated with Claude Code

set -u causes ${PROMPT_PARTS[*]} to crash with "unbound variable" when
the array has no elements. Use ${var+value} syntax for safe expansion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant