Repository navigation
Commit 2fda1fb
silas-dandelion-cult
fix(auto-reply): suppress entire payload when trailing NO_REPLY token present
Previously normalizeReplyPayload stripped trailing NO_REPLY tokens but
delivered any preamble text because hasContent() passed on the remainder.
When agents prefixed a silent reply with internal reasoning (e.g.
"Here's my analysis: ...\n\nNO_REPLY"), the preamble would ship to users
as a visible bot message. The trailing NO_REPLY was the agent's signal to
suppress the entire turn, not 'deliver this with the token cleaned up'.
The fix: track whether stripSilentToken actually removed a trailing token
(stripped.length < text.length). When it did, suppress the entire payload
regardless of remaining content.
Updates two #30916 tests that previously encoded the strip-and-deliver
behavior, flipping them to assert suppression. Adds a new test covering
the chain-of-thought leak case explicitly.
Scope: fixes the non-streaming delivery path (block.enabled=false or
streaming.mode=off). Does NOT fix streaming-on with intermediate block
delivery, where blocks may already be sent before the final NO_REPLY
arrives. That case requires turn-level buffering and is out of scope
for this PR.1 parent cb2fc70 commit 2fda1fb
2 files changed
Lines changed: 18 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
74 | | - | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
75 | 80 | | |
76 | 81 | | |
77 | 82 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
109 | 109 | | |
110 | 110 | | |
111 | 111 | | |
112 | | - | |
| 112 | + | |
113 | 113 | | |
114 | | - | |
115 | | - | |
116 | | - | |
| 114 | + | |
117 | 115 | | |
118 | 116 | | |
119 | | - | |
| 117 | + | |
120 | 118 | | |
121 | 119 | | |
122 | 120 | | |
123 | | - | |
124 | | - | |
125 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
126 | 129 | | |
127 | 130 | | |
128 | 131 | | |
| |||
0 commit comments