Bug: Whitespace normalization mismatch in Ralph Wiggum stop hook causes completion promise comparison to fail
Resolved 💬 1 comment Opened Apr 23, 2026 by sakal-s Closed May 27, 2026
Description
In plugins/ralph-wiggum/hooks/stop-hook.sh (lines 119, 123), the completion promise text extracted from output is whitespace-normalized via s/\s+/ /g, but the stored COMPLETION_PROMISE value is not normalized. This causes the comparison to fail when the user's promise contains multiple consecutive spaces.
Steps to Reproduce
- Set a completion promise with multiple spaces:
--completion-promise 'TASK DONE' - The promise is stored as-is:
"TASK DONE"(4 spaces) - When extracted from output, whitespace is normalized to single spaces:
"TASK DONE" - The comparison fails:
"TASK DONE" != "TASK DONE"
Expected Behavior
The completion promise should be detected regardless of whitespace differences between the stored promise and the output text.
Suggested Fix
Normalize whitespace on the stored COMPLETION_PROMISE as well before comparison, or normalize both sides at comparison time.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗