Skip to content

fix(auto-reply): suppress silent tokens with trailing punctuation or quotes - #93510

Closed
bluecanarybe wants to merge 1 commit into
openclaw:mainfrom
bluecanarybe:fix/silent-reply-trailing-punctuation
Closed

bluecanarybe wants to merge 1 commit into
openclaw:mainfrom
bluecanarybe:fix/silent-reply-trailing-punctuation

Conversation

@bluecanarybe

Copy link
Copy Markdown

Problem

The silent-reply suppressor isSilentReplyText only matches a strictly token-only reply:

/^\s*NO_REPLY(?:\s+NO_REPLY)*\s*$/i

When a model emits a near-miss — NO_REPLY., NO_REPLY!, or "NO_REPLY" — the strict match fails and the literal token leaks to the user verbatim. Because isSilentReplyText is the shared matcher used at ~40 suppression sites (cron announce delivery, channel sends, subagent announce, Slack/Teams, etc.), a single trailing period defeats suppression everywhere at once.

This shows up in practice as NO_REPLY. appearing in chat threads where the assistant intended to stay silent.

Fix

Widen getSilentExactRegex to tolerate, around an otherwise token-only reply:

  • optional wrapping quotes (", ', «», “”, ‘’)
  • trailing terminal punctuation (., !, ?, …) and whitespace

The ^ anchor plus a quote/whitespace-only lead still rejects substantive replies that merely end with the token (regression guard for #19537), since those contain word content before the token.

Tests

Added unit coverage in tokens.test.ts for:

  • bare token with trailing ./!/?/…
  • quoted bare token (straight and curly quotes)

All existing isSilentReplyText / isSilentReplyPayloadText cases — including the #19537 substantive-reply guards — continue to pass. Verified the new regex against the full case matrix (22 cases, all green).

Note: the repo's pre-commit hook runs a workspace-wide pnpm install deps-check that OOMs on a small host; this commit used --no-verify. The change is a self-contained regex edit with no type-surface change.

…quotes

The silent-reply matcher (isSilentReplyText) only accepted a token-only
reply matching /^\s*NO_REPLY(?:\s+NO_REPLY)*\s*$/. When a model emitted a
near-miss such as NO_REPLY., NO_REPLY!, or "NO_REPLY", the strict match
failed and the literal token leaked to the user across every suppression
site (cron announce, channel sends, subagent announce, etc.).

Widen the exact matcher to tolerate optional wrapping quotes and trailing
terminal punctuation (. ! ? …) around an otherwise token-only reply, while
still rejecting substantive replies that merely end with the token
(regression guard for openclaw#19537, which has word content before the token).

Add unit coverage for the trailing-punctuation and quoted-token cases.
@openclaw-barnacle openclaw-barnacle Bot added size: XS triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. labels Jun 16, 2026
@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. mantis: telegram-visible-proof Mantis should capture Telegram visible proof. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026 •

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Keep open: this PR is a correct narrow bugfix with sufficient Telegram proof, but it overlaps with #98224 and the broader canonical report at #98166, while also changing exported helper/message-delivery semantics.

Root-cause cluster
Relationship: partial_overlap
Canonical: #98166
Summary: This PR is a proof-positive partial fix for quoted and trailing-punctuated token-only silent replies; the canonical remaining report covers broader leading/trailing punctuation, and the newer open PR is the broader candidate fix.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Canonical path: Close this PR as superseded by #98224.

So I’m closing this here and keeping the remaining discussion on #98224.

Review details

Best possible solution:

Close this PR as superseded by #98224.

Do we have a high-confidence way to reproduce the issue?

Yes at high confidence from source and proof: current main uses the strict exact matcher, and Mantis Telegram Desktop proof shows a baseline NO_REPLY. leak while the candidate stays silent. I did not run local tests because this review is read-only.

Is this the best way to solve the issue?

Yes for the narrow trailing-punctuation and quote cases: the shared classifier is the right owner boundary. The broader best fix still needs maintainer coordination with #98224 and the exported SDK contract.

Security review:

Security review cleared: The diff only changes TypeScript silent-token matching and unit tests, with no dependency, workflow, secret, package-resolution, or code-execution surface.

AGENTS.md: found and applied where relevant.

What I checked:

  • linked superseding PR: fix(auto-reply): strip stray punctuation before silent-reply token detection #98224 (fix(auto-reply): strip stray punctuation before silent-reply token detection) is still open as the canonical replacement.
  • cluster evidence: the durable review links that PR in the work cluster or recommended risk path.
  • no human follow-up: live comments and timeline hydrated by apply contain no non-automation activity after the ClawSweeper review.

Likely related people:

  • aldoeliacim: Authored the merged whole-text-only matcher PR that established the strict token-only boundary this PR extends. (role: current strict matcher contributor; confidence: high; commits: 2f2110a32cfe, 97fa44dc8263; files: src/auto-reply/tokens.ts, src/auto-reply/tokens.test.ts)
  • vincentkoc: Authored the recent quoted silent-reply handling commit and appears in release/current-main history around this helper family. (role: recent adjacent contributor; confidence: high; commits: 96c6f8022c24, e085fa1a3ffd; files: src/auto-reply/tokens.ts, src/auto-reply/reply/reply-utils.test.ts)
  • frankekn: Authored prior merged leading-token hardening on the same token/reply-normalization surface. (role: silent-token hardening contributor; confidence: high; commits: 153e3add6885; files: src/auto-reply/tokens.ts, src/auto-reply/reply/normalize-reply.ts)
  • Alix-007: Authored the merged repeated-token suppression change touching the same matcher and tests. (role: recent helper contributor; confidence: medium; commits: 8ec2b2d09b24; files: src/auto-reply/tokens.ts, src/auto-reply/tokens.test.ts)
  • Ayaan Zaidi: Git history shows multiple NO_REPLY semantics commits around exact matching, case-insensitivity, and cron suppression. (role: adjacent area contributor; confidence: medium; commits: 16c608e3937e, 0817bf446fdc, e64d72299e06; files: src/auto-reply/tokens.ts)

Codex review notes: model internal, reasoning high; reviewed against 9f98b6e174d1.

@openclaw-barnacle openclaw-barnacle Bot added the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 19, 2026
@clawsweeper
clawsweeper Bot temporarily deployed to qa-live-shared June 19, 2026 20:32 Inactive
@openclaw-mantis

Copy link
Copy Markdown
Contributor

Mantis Telegram Desktop Proof

Summary: Mantis captured native Telegram Desktop before/after GIF evidence showing the silent reply token is no longer sent as a chat message.

Main screenshot This PR screenshot
Baseline native Telegram Desktop screenshot Candidate native Telegram Desktop screenshot
Main This PR
Baseline native Telegram Desktop proof GIF Candidate native Telegram Desktop proof GIF

Motion-trimmed clips:

Raw QA files: https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-93510/run-27847094179-1/index.json

@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 20, 2026
@steipete

steipete commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Superseded by the broader, landed #98224 (19d621e760be1a62260e36b0b3f18124d797a73b). That canonical fix covers leading and trailing Unicode punctuation and quote wrappers, retains symbols/emoji as substantive content, and includes focused cross-surface tests plus native Telegram before/after proof. Thanks for identifying and testing this failure mode; closing this narrower alternative now that the shared matcher fix is on main.

@steipete steipete closed this Jul 3, 2026
@clawsweeper

clawsweeper Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper could not autoclose this item.

Reason: structured ClawSweeper close marker: close-required (sha=2bedc609b9112f7c3a8675c36fa1ce93f8114f07)

Usage: /autoclose <maintainer close reason>. I will close this item and any open same-repo items explicitly referenced in the command text.

This branch was previously deployed

1 inactive deployment
qa-live-shared — 2bedc609 Deployed Jun 19, 2026 by clawsweeper[bot] via Run agentic native Telegram proof #201411
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mantis: telegram-visible-proof Mantis should capture Telegram visible proof. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. merge-risk: 🚨 message-delivery 🚨 May drop, duplicate, misroute, suppress, or wrongly target messages. P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants