Skip to content

Silent-reply sentinel (NO_REPLY) leaks to channel when wrapped in punctuation (e.g. ".NO_REPLY") #98166

Closed

Description

@tersuna

Summary

A token-only silent reply leaks to the channel as visible prose when the model emits the sentinel with stray leading/trailing punctuation — most commonly a hallucinated leading dot, .NO_REPLY. We've observed this reproduce on ordinary traffic (a Slack agent posting a literal .NO_REPLY instead of staying silent).

Version

[email protected]

Root cause

In src/auto-reply/tokens.ts, isSilentReplyText() matches the sentinel with an exact regex:

new RegExp(`^\\s*${escaped}(?:\\s+${escaped})*\\s*$`, "i")

A leading . (or any non-whitespace punctuation) sits before ^\s*NO_REPLY, so the match fails and the reply is delivered. The sibling matchers in isSilentReplyPayloadText() don't catch it either: isSilentReplyEnvelopeText requires a {…} JSON envelope, and isReasoningPrefixedSilentReplyText requires a reasoning prefix. So .NO_REPLY, NO_REPLY., *NO_REPLY*, ...NO_REPLY... all leak.

Reproduction

import { isSilentReplyPayloadText } from "./auto-reply/tokens";
isSilentReplyPayloadText("NO_REPLY");   // true  (suppressed, correct)
isSilentReplyPayloadText(".NO_REPLY");  // false (LEAKS — bug)
isSilentReplyPayloadText("*NO_REPLY*"); // false (LEAKS)

Suggested fix

Normalize leading/trailing non-alphanumeric (Unicode-aware) chars and re-test, in isSilentReplyText — keeping it a token-only check so mixed content ("the sentinel is NO_REPLY, fyi") is unaffected:

function stripEdgeNonAlnum(text) {
  return text.replace(/^[^\p{L}\p{N}]+/u, "").replace(/[^\p{L}\p{N}]+$/u, "");
}
function isSilentReplyText(text, token = SILENT_REPLY_TOKEN) {
  if (!text) return false;
  if (getSilentExactRegex(token).test(text)) return true;
  const normalized = stripEdgeNonAlnum(text);
  return normalized !== text && getSilentExactRegex(token).test(normalized);
}

Verified against the installed dist build: with this change, .NO_REPLY / NO_REPLY. / *NO_REPLY* / ...NO_REPLY... all suppress, while real replies and prose that merely mention the token still deliver. Happy to send a PR if useful.

Activity

  1. clawsweeper commented on Jun 30, 2026

    @clawsweeper
    Contributor

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed June 30, 2026, 10:22 AM ET / 14:22 UTC.

    Summary
    Keep open: current main and the latest release still use an exact silent-token matcher, while the overlapping open PR only covers trailing punctuation/quotes and does not cover leading-dot or star-wrapped token-only leaks.

    Reproducibility: yes. at source level: current main's exact regex rejects .NO_REPLY, NO_REPLY., *NO_REPLY*, and ...NO_REPLY..., and those payloads then miss the shared suppression classifier. I did not run a live Slack or channel delivery path in this read-only review.

    Root-cause cluster
    Relationship: canonical
    Canonical: #98166
    Summary: This issue is the narrow remaining report for leading/trailing punctuation wrapped token-only NO_REPLY; the open PR is a partial fix candidate for trailing punctuation and quotes, while the older broad issue covers a larger product/security policy question.

    Members:

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

    Next step
    Needs maintainer review because the fix should align with the overlapping open PR and would broaden an exported silent-reply helper contract.

    Review details

    Best possible solution:

    Define one shared token-only silent-reply classifier that tolerates maintainer-approved edge punctuation, preserves substantive replies, and lands in coordination with the overlapping open PR.

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

    Yes, at source level: current main's exact regex rejects .NO_REPLY, NO_REPLY., *NO_REPLY*, and ...NO_REPLY..., and those payloads then miss the shared suppression classifier. I did not run a live Slack or channel delivery path in this read-only review.

    Is this the best way to solve the issue?

    Unclear until maintainers settle the exported helper contract. The best implementation shape is the shared classifier, but it should be aligned with #93510 and the existing substantive-reply guards.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • The likely fix changes behavior of isSilentReplyText, which is exported through plugin SDK subpaths, so maintainers should decide the supported edge-punctuation contract before merging a broad classifier change.
    • The open overlapping PR covers trailing punctuation and quotes but not the leading-dot/star examples from this issue, so landing it alone would leave part of this report open.

    Codex review notes: model internal, reasoning high; reviewed against 6cb82eaab865.

    Label changes

    Label changes:

    • add issue-rating: 🦞 diamond lobster: Current issue advisory state selects this label.
    • add clawsweeper:source-repro: Current issue advisory state selects this label.
    • add clawsweeper:no-new-fix-pr: Current issue advisory state selects this label.
    • add clawsweeper:needs-maintainer-review: Current issue advisory state selects this label.
    • add clawsweeper:needs-product-decision: Current issue advisory state selects this label.

    Label justifications:

    • P2: This is a normal-priority channel delivery correctness issue with clear source evidence but limited blast radius and an existing overlapping PR path.
    • impact:message-loss: The issue is about silent-reply delivery semantics causing a message that should be suppressed to appear in a channel.
    Evidence reviewed

    What I checked:

    Likely related people:

    • aldoeliacim: Authored the merged whole-text-only isSilentReplyText change that established the strict exact-token boundary this report would broaden. (role: current strict matcher author; confidence: high; commits: 2f2110a32cfe, bb93dba10170; files: src/auto-reply/tokens.ts, src/auto-reply/tokens.test.ts)
    • obviyus: Merged the strict matcher PR and authored follow-up silent-token semantics and streaming-prefix work in the same helper surface. (role: merger and adjacent contributor; confidence: high; commits: e64d72299e06, b0091d293ac5, 203ec4f6cc2a; files: src/auto-reply/tokens.ts, src/auto-reply/tokens.test.ts, src/auto-reply/reply/typing.ts)
    • frankekn: Authored the merged leading-token hardening path around NO_REPLY leakage, which is adjacent to this leading-punctuation variant. (role: silent-token hardening contributor; confidence: high; commits: 153e3add6885, 9ce813b414ae, ce345a097c24; files: src/auto-reply/tokens.ts, src/auto-reply/reply/normalize-reply.ts, src/auto-reply/reply/reply-utils.test.ts)
    • vincentkoc: Recently touched the same silent-reply classifier surface for quoted silent replies on current main. (role: recent area contributor; confidence: medium; commits: 96c6f8022c24; files: src/auto-reply/tokens.ts)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2
    impact:message-loss
    no-stale
    issue-rating: 🦞 diamond lobster
    clawsweeper:source-repro
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    on Jun 30, 2026
  3. steipete commented on Jul 3, 2026

    @steipete
    Contributor

    Fixed on main by #98224 (19d621e760be1a62260e36b0b3f18124d797a73b). The canonical matcher now suppresses punctuation-wrapped token-only replies while preserving symbol/emoji-prefixed content; 97 focused tests, exact-head CI, clean autoreview, and native Telegram before/after proof are recorded on the PR. Closing as resolved.

  4. locked as resolved and limited conversation to collaborators on Jul 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-prclawsweeper:source-reproimpact:message-lossissue-rating: 🦞 diamond lobsterno-stale

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions