Repository navigation
Conversation
With streaming: partial, the first tokens of NO_REPLY ("NO") leak
to channels like Telegram as a visible message before the full
directive is recognized. Check isSilentReplyPrefixText before calling
onPartialReply so all channels benefit from early suppression.
Closes openclaw#33544
Greptile SummaryThis PR fixes a UX bug where partial
Confidence Score: 4/5
Last reviewed commit: 7c9faa0 |
Additional Comments (1)
The new guard correctly blocks If the intent is strictly to protect only the channel-specific const isSilentPrefix = isSilentReplyPrefixText(cleanedText, SILENT_REPLY_TOKEN);
if (!isSilentPrefix) {
emitAgentEvent({ ... });
void ctx.params.onAgentEvent?.({ ... });
}
ctx.state.emittedAssistantUpdate = true;
if (ctx.params.onPartialReply && ctx.state.shouldEmitPartialReplies) {
if (!isSilentPrefix) {
void ctx.params.onPartialReply({ ... });
}
}Worth confirming this is intentional before merging. |
|
Thanks for the fix proposal. We re-verified this path in current main and this specific NO_REPLY lead-fragment leak is already handled upstream in the shared streaming runner (before channel partial callbacks), with additional Telegram boundary/silent-token hardening already landed. So this PR is now redundant. The fix is already queued for the next release line (2026.3.3). Closing this PR so we keep one source of truth for the behavior. |
Summary
streaming: partialenabled, the first streamed tokens ofNO_REPLY(e.g.,"NO") are emitted to clients viaonPartialReplybefore the full directive is recognized. Channels like Telegram briefly display "NO" as a visible message to the user before the reply is suppressed.src/agents/pi-embedded-subscribe.handlers.messages.ts— importedisSilentReplyPrefixTextandSILENT_REPLY_TOKEN; added a check beforeonPartialReplythat suppresses emission when the accumulated text matches a known silent reply prefix.NO_REPLYdetection, non-streaming paths, and theisSilentReplyPrefixTextutility itself are unchanged.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Security Impact (required)
NoNoNoNoNoRepro + Verification
Environment
streaming: partialSteps
streaming: partialand connect via TelegramNO_REPLYExpected
Actual
Evidence
The
isSilentReplyPrefixTextutility is already well-tested insrc/auto-reply/tokens.test.ts. The change adds a single guard clause that leverages this existing utility.Human Verification (required)
Compatibility / Migration
YesNoNoFailure Recovery (if this breaks)
src/agents/pi-embedded-subscribe.handlers.messages.tsisSilentReplyPrefixTextonly matching exact NO_REPLY prefixes)Risks and Mitigations
isSilentReplyPrefixTextis a narrow check — it only suppresses text that is an exact prefix of the configuredSILENT_REPLY_TOKEN. Normal messages starting with "No" or "Not" are unaffected.