You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
bug: NO_REPLY suppression bypassed for thread-based and structured-content delivery #45909
SILENT_REPLY_TOKEN (NO_REPLY) suppression only works in the finalizeTextDelivery path. When useDirectDelivery = true (thread-based delivery or structured content), the check is skipped and the literal string NO_REPLY is delivered to the channel.
Root cause
delivery-dispatch.ts:
constuseDirectDelivery=params.deliveryPayloadHasStructuredContent||params.resolvedDelivery.threadId!=null;if(useDirectDelivery){// deliverViaDirect — no SILENT_REPLY_TOKEN check}else{// finalizeTextDelivery — has the check at line 494}
The NO_REPLY check at line 494 is inside finalizeTextDelivery, which is only called when useDirectDelivery is false.
Expected behavior
NO_REPLY should suppress delivery regardless of delivery path. A cron job using --thread or returning structured content should not leak NO_REPLY as a literal message.
Suggested fix
Move the SILENT_REPLY_TOKEN check before the useDirectDelivery branch so it applies to both paths.
Confirmed the root cause. In src/cron/isolated-agent/delivery-dispatch.ts, the SILENT_REPLY_TOKEN check at line 494 only runs inside finalizeTextDelivery. When useDirectDelivery = true (because threadId != null or structured content), deliverViaDirect is called instead — and it has no NO_REPLY gate, so the literal string gets sent to the channel.
Fix is straightforward: move the suppression check before the useDirectDelivery branch so both delivery paths are covered. Also guards against deliveryPayloads containing only NO_REPLY text items.
Current main already suppresses NO_REPLY on the direct-delivery path used for structured-content and threaded cron delivery, and the latest release tag contains the same implementation and regression test coverage.
What I checked:
Direct-delivery path filters silent replies before outbound send:normalizeSilentReplyText strips exact/leading/trailing silent tokens, and deliverViaDirect maps every direct-delivery payload through that helper before calling the outbound adapter. Silent-only payload sets short-circuit to finishSilentReplyDelivery() instead of sending. (src/cron/isolated-agent/delivery-dispatch.ts:44, f03252aaf9cc)
Issue path still goes through the filtered direct-delivery branch: The structured-content/threaded branch sets useDirectDelivery and calls deliverViaDirectAndCleanup, so the silent-token filtering now applies to exactly the path described in the issue. (src/cron/isolated-agent/delivery-dispatch.ts:825, f03252aaf9cc)
Regression tests cover the reported direct-delivery leak: The test suite includes a structured-content direct-delivery case asserting NO_REPLY does not reach deliverOutboundPayloads, plus direct-delivery whitespace and trailing-token variants. (src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts:821, f03252aaf9cc)
Latest shipped release already contains the same code and test: Diffing v2026.4.22 (00bd2cf7a376f1fba26291c6c4766f1f15cbdfa5) against current main for the affected implementation and regression-test files returns no diff, so the fix is already shipped in the latest release. (00bd2cf7a376)
So I’m closing this as already implemented rather than keeping a duplicate issue open.
Activity
jackjin1997 commentedon Mar 14, 2026
Confirmed the root cause. In
src/cron/isolated-agent/delivery-dispatch.ts, theSILENT_REPLY_TOKENcheck at line 494 only runs insidefinalizeTextDelivery. WhenuseDirectDelivery = true(becausethreadId != nullor structured content),deliverViaDirectis called instead — and it has no NO_REPLY gate, so the literal string gets sent to the channel.Fix is straightforward: move the suppression check before the
useDirectDeliverybranch so both delivery paths are covered. Also guards againstdeliveryPayloadscontaining only NO_REPLY text items.PR incoming.
fix(cron): suppress NO_REPLY on thread-based and structured delivery
steipete commentedon Apr 25, 2026
Closing this as implemented after Codex review.
Current
mainalready suppressesNO_REPLYon the direct-delivery path used for structured-content and threaded cron delivery, and the latest release tag contains the same implementation and regression test coverage.What I checked:
normalizeSilentReplyTextstrips exact/leading/trailing silent tokens, anddeliverViaDirectmaps every direct-delivery payload through that helper before calling the outbound adapter. Silent-only payload sets short-circuit tofinishSilentReplyDelivery()instead of sending. (src/cron/isolated-agent/delivery-dispatch.ts:44, f03252aaf9cc)useDirectDeliveryand callsdeliverViaDirectAndCleanup, so the silent-token filtering now applies to exactly the path described in the issue. (src/cron/isolated-agent/delivery-dispatch.ts:825, f03252aaf9cc)NO_REPLYdoes not reachdeliverOutboundPayloads, plus direct-delivery whitespace and trailing-token variants. (src/cron/isolated-agent/delivery-dispatch.double-announce.test.ts:821, f03252aaf9cc)v2026.4.22(00bd2cf7a376f1fba26291c6c4766f1f15cbdfa5) against currentmainfor the affected implementation and regression-test files returns no diff, so the fix is already shipped in the latest release. (00bd2cf7a376)So I’m closing this as already implemented rather than keeping a duplicate issue open.
Review notes: reviewed against f03252aaf9cc; fix evidence: release v2026.4.22, commit 00bd2cf7a376.