Skip to content

fix(linux): use loop_limit null instead of osascript#1

Open
advancegabrielguihurt wants to merge 1 commit into
hexsprite:masterfrom
advancegabrielguihurt:feat/linux-support
Open

fix(linux): use loop_limit null instead of osascript#1
advancegabrielguihurt wants to merge 1 commit into
hexsprite:masterfrom
advancegabrielguihurt:feat/linux-support

Conversation

@advancegabrielguihurt

Copy link
Copy Markdown

Summary

The Ralph loop stopped on Linux after 5 iterations because the stop hook used macOS-only osascript to continue the loop. On Linux, osascript is missing; the hook exits without emitting followup_message, so the loop dies silently.

Fix: register the stop hook with "loop_limit": null in hooks.json (documented in hooks/hooks.json.example). Cursor then accepts unlimited followup_message chains — the same approach used by ericzakariasson/ralph-loop-plugin.

This PR also:

  • Simplifies ralph-loop-stop.sh to always emit followup_message (removes session_iterations + osascript path)
  • Adds optional continue-linux.sh (xdotool/ydotool/wtype) for legacy installs that cannot set loop_limit: null
  • Updates README and /ralph-loop command docs

Root cause

Iteration macOS Linux (before)
1–4 followup_message followup_message
5+ osascript types /ralph-loop --continue osascript fails → loop stops

Cursor's default stop-hook loop_limit is 5 (hooks docs). Setting it to null removes the cap on all platforms.

Test plan

  • Copy hooks/hooks.json.example into project .cursor/hooks.json with correct script path
  • chmod +x hooks/ralph-loop-stop.sh
  • Run /ralph-loop "echo iteration test" --max-iterations 8 and confirm iterations continue past 5
  • Confirm completion promise / max-iterations still stop the loop cleanly

Made with Cursor

Cursor caps followup_message chains at 5 unless loop_limit is null.
The previous macOS-only osascript workaround silently failed on Linux
at iteration 5, stopping the loop.

- Add hooks/hooks.json.example with loop_limit: null
- Simplify stop hook to always emit followup_message
- Add optional continue-linux.sh keyboard fallback for legacy configs
- Document Linux requirements in README and ralph command

Co-authored-by: Cursor <cursoragent@cursor.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.

2 participants