Took me a while to track this one down. ralph.sh runs with set -e, and display_final_summary in scripts/lib/output.sh bumps its counter with ((line_count++)). That form returns the value before the increment, so when line_count is 0 the arithmetic command exits 1 and set -e kills the whole script.
$ bash -c 'set -e; n=0; echo before; ((n++)); echo after'
before
$ echo $?
1
Net effect is the run dies partway through printing the first summary and never reaches iteration 2, no matter what you pass to -n. What you see:
─────────────────────────────────────────────────────────────────
Iteration Summary
─────────────────────────────────────────────────────────────────
Bash command=find .agent/screenshots -type f 2>&1
📦 Stopping sandbox ralph-claude-...
Note the missing closing separator and no └── ✓ Iteration 1 complete. It exits 1, which is the same as EXIT_MAX_ITERATIONS, so at a glance it just looks like the run ended normally. That's what threw me for a while.
Both hits are in display_final_summary, lines 164 and 168. Swapping them for line_count=$((line_count + 1)) fixes it since assignment always returns 0.
preview.sh:70 also has an i++ but it's the for ((...)) form, where the status isn't propagated, so that one's fine.
Nothing Windows-specific here, should hit any bash.
Took me a while to track this one down.
ralph.shruns withset -e, anddisplay_final_summaryinscripts/lib/output.shbumps its counter with((line_count++)). That form returns the value before the increment, so whenline_countis 0 the arithmetic command exits 1 andset -ekills the whole script.Net effect is the run dies partway through printing the first summary and never reaches iteration 2, no matter what you pass to
-n. What you see:Note the missing closing separator and no
└── ✓ Iteration 1 complete. It exits 1, which is the same asEXIT_MAX_ITERATIONS, so at a glance it just looks like the run ended normally. That's what threw me for a while.Both hits are in
display_final_summary, lines 164 and 168. Swapping them forline_count=$((line_count + 1))fixes it since assignment always returns 0.preview.sh:70also has ani++but it's thefor ((...))form, where the status isn't propagated, so that one's fine.Nothing Windows-specific here, should hit any bash.