Skip to content

fix(ralph-wiggum): case-insensitive completion promise matching#67753

Open
nahrinoda wants to merge 1 commit into
anthropics:mainfrom
nahrinoda:fix/ralph-wiggum-promise-matching
Open

fix(ralph-wiggum): case-insensitive completion promise matching#67753
nahrinoda wants to merge 1 commit into
anthropics:mainfrom
nahrinoda:fix/ralph-wiggum-promise-matching

Conversation

@nahrinoda

Copy link
Copy Markdown

Summary

  • Completion promise matching now uses case-insensitive comparison with whitespace normalization, preventing false negatives when Claude outputs casing that differs from the configured promise (e.g. Complete vs COMPLETE)
  • Uses tr instead of ${var,,} for portability with macOS default Bash 3
  • Updated README to reflect the new matching behavior

Problem

The stop hook used exact string comparison for completion promises. This caused loops to continue unnecessarily when:

  • Claude output <promise>Complete</promise> but the promise was set to COMPLETE
  • YAML parsing introduced leading/trailing whitespace in the configured promise

Test plan

  • Verified case-insensitive matching (COMPLETE vs Complete) — matches
  • Verified whitespace normalization (DONE vs DONE ) — matches
  • Verified non-matching strings (SUCCESS vs COMPLETE) — correctly rejects
  • Verified portability with Bash 3 on macOS (no ${var,,} syntax)

🤖 Generated with Claude Code

…and whitespace-tolerant

Promise matching previously used exact string comparison, causing false
negatives when Claude output casing differed from the configured promise
(e.g. "Complete" vs "COMPLETE") or when YAML parsing introduced extra
whitespace. Both sides are now normalized and lowercased before comparison.

Uses tr for portability with macOS default Bash 3.

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