Skip to content

fix: NO_REPLY check should use trim + word-boundary regex#86

Merged
fitz123 merged 5 commits intomainfrom
no-reply-trim
Apr 4, 2026
Merged

fix: NO_REPLY check should use trim + word-boundary regex#86
fitz123 merged 5 commits intomainfrom
no-reply-trim

Conversation

@fitz123
Copy link
Copy Markdown
Owner

@fitz123 fitz123 commented Apr 4, 2026

Summary

  • Fix NO_REPLY detection to handle trailing text/whitespace (e.g. NO_REPLY\n\nExplanation...)
  • Changed from exact match to trim() + word-boundary regex
  • Applied to both cron-runner.ts and stream-relay.ts
  • Added tests for all edge cases

Closes #80

Test plan

  • NO_REPLY exact — swallowed
  • NO_REPLY\n\nSome text — swallowed
  • NO_REPLY — swallowed
  • NO_REPLY_EXTRA — NOT swallowed (word boundary)
  • Regular output — delivered
  • All 878 tests pass

🤖 Generated with Claude Code

fitz123 and others added 5 commits April 4, 2026 15:08
NO_REPLY with trailing text or whitespace was bypassing exact match and
getting delivered to users. Changed both cron-runner.ts and stream-relay.ts
to use output.trim().startsWith("NO_REPLY").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Tighten NO_REPLY match from startsWith to word-boundary regex
  /^NO_REPLY(\s|$)/ to avoid false positives on NO_REPLY_EXTRA etc.
- Add negative test for NO_REPLY substring prefix (NO_REPLY_EXTRA)
- Remove unnecessary null-coalescing on non-nullable accumulated var
- Fix sendTyping to skip DM chats (pre-existing test failure)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add content assertion to NO_REPLY_EXTRA boundary test
- Update plan to reflect regex approach (was stale from startsWith era)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@fitz123 fitz123 merged commit 0922e75 into main Apr 4, 2026
1 check passed
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.

fix: NO_REPLY check should use trim/startsWith instead of exact match

1 participant