-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Discord leaks internal tool-call traces (NO_REPLY, commentary, to=functions) to channel #44905
Copy link
Copy link
Open
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P1High-priority user-facing bug, regression, or broken workflow.High-priority user-facing bug, regression, or broken workflow.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.ClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.ClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.impact:message-lossChannel message delivery can be lost, duplicated, or misrouted.Channel message delivery can be lost, duplicated, or misrouted.impact:securitySecurity boundary, credential, authz, sandbox, or sensitive-data risk.Security boundary, credential, authz, sandbox, or sensitive-data risk.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Summary
Discord channels occasionally surface internal LLM tool-call artifacts that should never be visible to end-users. The leaked content includes:
NO_REPLYto=functions.memory_searchcommentary{"query":"...","maxResults":5})recipient_name/parametersenvelope fieldsOther channels (Telegram, WhatsApp, Signal) do not exhibit this issue.
Expected Behavior
NO_REPLYshould be consumed silently — never sent to any channel.commentary,to=functions.*, tool-call JSON, and other internal envelope fields should be stripped before delivery.Actual Behavior
Discord intermittently delivers raw internal messages as visible chat messages in the channel.
Root Cause Analysis
Traced through the delivery pipeline in
v2026.3.8:1. Discord missing from
PLAIN_TEXT_SURFACES(src/infra/outbound/sanitize-text.ts)normalizePayloadsForChannelDelivery()callssanitizeForPlainText()only for surfaces in this set. Discord payloads skip sanitization entirely.2.
sanitizeTextContent()does not strip tool-routing traces (src/auto-reply/extract-text.ts)This strips thinking tags and Minimax XML, but does not catch:
NO_REPLYto=functions.*commentary3.
sendDiscordText()has no pre-send filter (src/infra/send/discord.ts)The Discord send path serializes and posts the text chunk directly — no final sanitization gate.
4.
NO_REPLYsuppression has a gap (src/infra/outbound/normalize.ts)In
normalizeReplyPayloadsForDelivery, silent payloads are only suppressed whenmergedMedia.length === 0. Payloads with media attached can pass through withNO_REPLYstill in the text.High-Probability Trigger Scenarios
NO_REPLYreturn branchesSuggested Fix
Add a universal outbound sanitizer in
normalizePayloadsForChannelDelivery(or equivalent) that runs for all channels, not just plain-text surfaces:Also enhance
sanitizeTextContent()to strip the same patterns at the extraction layer.Environment