fix: tighten isSilentReplyText to match whole-text only#19576
fix: tighten isSilentReplyText to match whole-text only#19576obviyus merged 4 commits intoopenclaw:mainfrom
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
you have been detected be spamming with unwarranted prs and issues and your issues and prs have been automatically closed. please read contributing guide Contributing.md. |
The suffix regex matched NO_REPLY at the end of any response, suppressing substantive replies when models (e.g. Gemini 3 Pro) appended NO_REPLY to real content. Replace prefix+suffix regexes with a single whole-string match. Only responses that are entirely the silent token (with optional whitespace) are now suppressed. Add unit tests for the fix. Fixes #19537
Greptile SummaryReplaces the overly permissive prefix + suffix regex pair in
Confidence Score: 5/5
Last reviewed commit: 8ed852d |
8ed852d to
b0091d2
Compare
|
Added follow-up fixes beyond the original regex tightening:
Current head: |
|
Landed via temp rebase onto main. Thanks @aldoeliacim! |
…ldoeliacim) (cherry picked from commit 97fa44d) # Conflicts: # CHANGELOG.md
…ldoeliacim) (cherry picked from commit 97fa44d) # Conflicts: # CHANGELOG.md
Problem
isSilentReplyText()uses a suffix regex (\bNO_REPLY\b\W*$) that matchesNO_REPLYat the end of any response text, even when preceded by substantive content. This causes legitimate replies to be silently suppressed and never delivered to the user.Observed with Gemini 3 Pro which appends
NO_REPLYto conversational replies, but any model could trigger this.Fix
Replace the prefix + suffix regex pair with a single whole-string match:
^\s*TOKEN\s*$. Only responses that are entirely the silent token (with optional whitespace) are now treated as silent.Tests
Added
src/auto-reply/tokens.test.tswith 7 test cases covering:All tests pass:
npx vitest run src/auto-reply/tokens.test.tsFixes #19537
Greptile Summary
Replaces overly permissive prefix/suffix regex matching with strict whole-string matching for silent reply detection. The old implementation used
\bNO_REPLY\b\W*$suffix pattern that matchedNO_REPLYat the end of any text, causing legitimate replies ending with the token to be silently suppressed. The new^\s*TOKEN\s*$pattern only treats responses that are entirely the silent token (with optional whitespace) as silent, fixing the regression where models like Gemini 3 Pro appendNO_REPLYto conversational responses.Confidence Score: 5/5
Last reviewed commit: a6e4442