Skip to content

fix(gateway): suppress empty-response lifecycle status in chats - #24519

Open
dfrolov wants to merge 1 commit into
NousResearch:mainfrom
dfrolov:fix/gateway-silent-empty-status
Open

fix(gateway): suppress empty-response lifecycle status in chats#24519
dfrolov wants to merge 1 commit into
NousResearch:mainfrom
dfrolov:fix/gateway-silent-empty-status

Conversation

@dfrolov

@dfrolov dfrolov commented May 12, 2026

Copy link
Copy Markdown

Summary

  • suppress empty-response retry/final lifecycle status messages before gateway adapters send them to chat
  • keep other lifecycle/status messages visible
  • complements fix(gateway): keep empty gateway responses silent #23672, which handles final empty response normalization but not status_callback diagnostics

Why

Quiet-by-default group bots can intentionally return an empty response as a no-op. Today the final response can be silent, but lifecycle diagnostics like:

⚠️ Empty response from model — retrying (1/3)
❌ Model returned no content after all retries. No fallback providers configured.

still leak into Telegram/other chat gateways via the lifecycle status callback.

Test Plan

docker run --rm -v /usr/local/lib/hermes-agent:/src -w /src hermes-agent \
  /opt/hermes/.venv/bin/python -m pytest \
  tests/test_lazy_session_regressions.py -q \
  -k GatewaySurfacesNullResponse -o addopts=

Result: 7 passed, 12 deselected.

@teknium1

Copy link
Copy Markdown
Contributor

Thanks for identifying a real remaining gateway-noise case. The premise still holds on current main: agent/conversation_loop.py:4978 buffers the retry status and agent/conversation_loop.py:5053-5056 emits the terminal status; buffered statuses reach status_callback through run_agent.py:1024-1028.

Problems

  • Current main has a shared status-filter path: gateway/run.py:440-457 is called before gateway delivery at gateway/run.py:17812-17830. The PR's callback-local helper would duplicate that policy rather than extend it. The current filter's alternatives at gateway/run.py:74-92 do not cover either exact empty-response message.
  • The PR tests only its new helper. Current multi-platform filter coverage is centralized in tests/gateway/test_telegram_noise_filter.py:57-75; add the two exact messages there, including a raw/programmatic negative case.

Suggested changes

  • Fold the two prefixes into the maintained shared filter and add regression coverage at the existing test surface. This also resolves the current PR conflict cleanly.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform labels Jul 13, 2026
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 sweeper:blast-moderate Sweeper blast radius: moderate — a subsystem or single platform sweeper:risk-compatibility Sweeper risk: may break existing users, config, migrations, defaults, or upgrades sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants