Skip to content

fix(gateway): suppress silent placeholder replies in live chats#9956

Open
luoxiao6645 wants to merge 1 commit into
NousResearch:mainfrom
luoxiao6645:fix/gateway-silent-placeholder-replies-9840
Open

fix(gateway): suppress silent placeholder replies in live chats#9956
luoxiao6645 wants to merge 1 commit into
NousResearch:mainfrom
luoxiao6645:fix/gateway-silent-placeholder-replies-9840

Conversation

@luoxiao6645

Copy link
Copy Markdown

Summary

  • suppress exact silent placeholder replies in both live gateway response paths and streaming delivery
  • prevent (No message), (No reply), [SILENT], and similar silence markers from being sent to Discord and other live chat platforms
  • add regression coverage for non-streaming and streaming silent placeholder cases

Problem

In live gateway chats, the model can decide it should stay silent but still emit placeholder text such as (No message), (No reply), or [SILENT].

The gateway was treating those placeholders as normal text and delivering them to Discord instead of suppressing delivery entirely.

Root Cause

The original live reply path had no normalization step for silence markers before adapter delivery. After the initial fix, the non-streaming path was covered, but the streaming consumer could still send the same placeholders through its send/edit/commentary/fallback paths.

Changes

  • extract shared live-response normalization into gateway/response_filters.py
  • suppress exact silence markers before normal live response delivery
  • suppress the same markers in the queued follow-up first-response path
  • suppress the same markers in streaming send, edit, commentary, and fallback delivery paths
  • preserve real errors and non-placeholder content
  • add regression tests for non-streaming and streaming placeholder behavior

Testing

  • venv\\Scripts\\python -m pytest tests/gateway/test_live_silent_responses.py tests/gateway/test_stream_consumer.py -q -n 0

Closes #9840

@luoxiao6645 luoxiao6645 force-pushed the fix/gateway-silent-placeholder-replies-9840 branch from 5f34c3a to a82048f Compare April 15, 2026 00:46
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery platform/discord Discord bot adapter labels Apr 26, 2026
aldoeliacim added a commit to aldoeliacim/hermes-agent that referenced this pull request Jun 8, 2026
…-inflate intentional silence (NousResearch#13248)

Builds on NousResearch#9956's response_filters boundary:
- Document NO_REPLY as the canonical harness-emitted SILENT_REPLY_TOKEN and
  list it explicitly in LIVE_GATEWAY_SILENT_MARKERS so the control-token
  contract no longer depends on the canonicalizer incidentally folding
  NO_REPLY -> 'no reply'.
- In _handle_message_with_agent, distinguish INTENTIONAL silence (a recognized
  silence marker on a non-failed turn) from an empty-generation FAILURE, and
  skip _normalize_empty_agent_response for the former so a deliberate NO_REPLY
  turn stays silent instead of being rewritten into 'no response was generated'
  chat noise. Empty failures still surface the user notice.
- Tests: lock the canonical-token suppression contract independent of the
  canonicalizer, the failed-output passthrough, prose-mention passthrough, and
  the intentional-silence-vs-empty-failure distinction at the handler level.
aldoeliacim added a commit to aldoeliacim/hermes-agent that referenced this pull request Jun 11, 2026
…-inflate intentional silence (NousResearch#13248)

Builds on NousResearch#9956's response_filters boundary:
- Document NO_REPLY as the canonical harness-emitted SILENT_REPLY_TOKEN and
  list it explicitly in LIVE_GATEWAY_SILENT_MARKERS so the control-token
  contract no longer depends on the canonicalizer incidentally folding
  NO_REPLY -> 'no reply'.
- In _handle_message_with_agent, distinguish INTENTIONAL silence (a recognized
  silence marker on a non-failed turn) from an empty-generation FAILURE, and
  skip _normalize_empty_agent_response for the former so a deliberate NO_REPLY
  turn stays silent instead of being rewritten into 'no response was generated'
  chat noise. Empty failures still surface the user notice.
- Tests: lock the canonical-token suppression contract independent of the
  canonicalizer, the failed-output passthrough, prose-mention passthrough, and
  the intentional-silence-vs-empty-failure distinction at the handler level.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/gateway Gateway runner, session dispatch, delivery P2 Medium — degraded but workaround exists platform/discord Discord bot adapter type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Discord replying when it's (No message) instead of not sending any message

2 participants