-
-
Notifications
You must be signed in to change notification settings - Fork 52.6k
Description
Bug
Version: 2026.3.1
Component: Reply pipeline / streaming partial suppression
Description
When an agent reply starts with NO_REPLY (the silent reply token), the partial text NO leaks to webchat as a visible streaming delta before the full suppression logic catches it.
Root Cause
handlePartialForTyping in reply-XaR8IPbY.js calls isSilentReplyPrefixText on each streaming delta. The function has an early-exit guard:
if (!normalized.includes('_')) return false;This means "NO" is not recognized as a prefix of NO_REPLY (because it has no underscore yet), so it passes through and gets pushed to webchat as a typing signal. By the time "NO_" arrives and would be caught, "NO" has already been rendered.
Reproduction
- Configure an agent that replies with only
NO_REPLY(the silent token) - Observe webchat —
NObriefly appears as a streamed partial before being suppressed - Final message is correctly suppressed; only the partial leaks
Expected Behavior
All prefixes of NO_REPLY that consist solely of uppercase letters (i.e., N, NO) should also be suppressed in handlePartialForTyping, even before the underscore arrives.
Suggested Fix
In isSilentReplyPrefixText, relax the includes('_') guard to also match pure-alpha prefixes that are a prefix of the token up to (but not including) the first _:
function isSilentReplyPrefixText(text, token = SILENT_REPLY_TOKEN) {
if (!text) return false;
const normalized = text.trimStart().toUpperCase();
if (!normalized) return false;
if (/[^A-Z_]/.test(normalized)) return false;
return token.toUpperCase().startsWith(normalized);
}Simply removing the includes('_') guard fixes the leak while keeping all existing behavior intact.
Impact
- Webchat users see a spurious
NOmessage when an agent uses the silent reply token - Affects any streaming webchat session on 2026.3.1