Repository navigation
Commit 19d621e
fix(auto-reply): strip stray punctuation before silent-reply token detection (#98224)
* [AI] fix(auto-reply): strip stray punctuation before silent-reply token detection
When the model emits .NO_REPLY or *NO_REPLY* instead of bare NO_REPLY,
isSilentReplyText() failed to detect it because the regex requires
the text to consist only of the token with optional whitespace.
Add stripEdgeNonAlnum() that strips leading/trailing non-letter,
non-number characters (Unicode-aware) before the regex test. This
catches stray punctuation while preserving the existing safeguard
against suppressing mixed-content text.
Related to #98166
Co-Authored-By: Claude <[email protected]>
* [AI] fix: strip only punct not emoji before silent-reply detection
Change stripEdgeNonAlnum to stripEdgePunct: strip only punctuation (\p{P}) instead of all non-letter/non-number characters. Emoji would be stripped by the former, causing false silent-reply on mixed content.
Related to #98166
Co-Authored-By: Claude <[email protected]>
* [AI] fix: preserve exact custom-token match before edge-punct normalization
Try exact regex match first, then fall back to stripEdgePunct.
This preserves exact matching for custom tokens whose first/last
character is punctuation (e.g. *SILENT*, #QUIET#), while still
catching the common case of NO_REPLY wrapped in stray punctuation.
Add regression test for punctuation-edged custom tokens.
ClawSweeper: #98224 (comment)
Related to #98166
Co-Authored-By: Claude <[email protected]>
* [AI] fix: handle whitespace-wrapped punctuation in silent-reply fallback
Trim whitespace before stripping edge punctuation in the fallback
path so variants like " .NO_REPLY " and "NO_REPLY. " are also
caught by the silent-reply detector.
Add regression coverage for whitespace-wrapped edge punctuation.
ClawSweeper: #98224 (comment)
Related to #98166
Co-Authored-By: Claude <[email protected]>
* test(auto-reply): tighten silent-token boundaries
---------
Co-authored-by: Claude <[email protected]>
Co-authored-by: Peter Steinberger <[email protected]>1 parent e0b2dda commit 19d621e
2 files changed
Lines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
112 | 143 | | |
113 | 144 | | |
114 | 145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
| |||
52 | 56 | | |
53 | 57 | | |
54 | 58 | | |
55 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
56 | 65 | | |
57 | 66 | | |
58 | 67 | | |
| |||
0 commit comments