fix(gateway): recognize (silence) as intentional silence marker - #46970
fix(gateway): recognize (silence) as intentional silence marker#46970vanthinh6886 wants to merge 1 commit into
Conversation
The gateway has an intentional-silence mechanism that suppresses delivery when the agent responds with markers like [SILENT], NO_REPLY, etc. However, "(silence)" — a natural placeholder that LLMs produce when instructed to remain silent — was not recognized, causing it to be delivered as literal text. Fix: add "(silence)" to LIVE_GATEWAY_SILENT_MARKERS so the gateway suppresses delivery and the agent can truly respond with nothing. Fixes NousResearch#46917
tonydwb
left a comment
There was a problem hiding this comment.
Code Review Summary
Verdict: Approved
Makes the gateway recognize (silence) as an intentional silence marker. Good UX fix (3 files, ~1.3KB diff).
Looks Good
- Simple, targeted fix
- No security or performance concerns
Reviewed by Hermes Agent (cron batch, 2026-06-16)
teknium1
left a comment
There was a problem hiding this comment.
Thanks for the focused gateway fix. The premise is still valid on current main, but the proposed registry spelling prevents the new behavior from working.
Problems
gateway/response_filters.py:23adds"(silence)", while_canonical_silence_candidate()uppercases every response before the membership check (gateway/response_filters.py:27-28,70). The candidate becomes"(SILENCE)", so the new lowercase marker cannot match; the two newly added assertions would fail.- The public supported-token list in
website/docs/user-guide/messaging/index.md:111-122is not updated.
Suggested changes
- Use the canonical registry value
"(SILENCE)". - Add a streamed
(silence)suppression case; the streaming path independently uses the shared predicates atgateway/stream_consumer.py:616-619and:655-659. - Document the new token.
This is an automated hermes-sweeper review.
| "SILENT", | ||
| "NO_REPLY", | ||
| "NO REPLY", | ||
| "(silence)", |
There was a problem hiding this comment.
This registry is compared against uppercase canonical candidates (_canonical_silence_candidate() calls .upper() before the membership check), so (silence) becomes (SILENCE) and will not match this lowercase entry. Please use "(SILENCE)" and retain lowercase input in the test.
Fixes #46917
The gateway has an intentional-silence mechanism that suppresses delivery when the agent responds with markers like
[SILENT],NO_REPLY, etc. However,(silence)— a natural placeholder that LLMs produce when instructed to remain silent — was not recognized, causing it to be delivered as literal text.Fix
Add
(silence)toLIVE_GATEWAY_SILENT_MARKERSingateway/response_filters.py.Before
Agent instructed to stay silent → LLM outputs
(silence)→ gateway delivers literal text(silence)to user.After
Agent instructed to stay silent → LLM outputs
(silence)→ gateway recognizes it as intentional silence → delivery suppressed, no message sent.