Skip to content

fix(gateway): keep empty gateway responses silent - #23672

Open
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/22712-silent-empty-gateway
Open

fix(gateway): keep empty gateway responses silent#23672
LeonSGP43 wants to merge 1 commit into
NousResearch:mainfrom
LeonSGP43:codex/22712-silent-empty-gateway

Conversation

@LeonSGP43

Copy link
Copy Markdown
Contributor

What does this PR do?

Keeps gateway chat channels silent when the agent ends a turn with no user-facing text.

The gateway currently turns empty results into backend-style warning text like (empty) fallbacks or synthetic failure messages. That makes valid silent outcomes look broken in shared chats. This change keeps those diagnostics internal for gateway delivery while preserving the existing helper behavior for non-gateway callers.

Related Issue

Fixes #22712

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • stop converting gateway (empty) sentinels into user-visible warning text in gateway/run.py
  • skip synthetic empty-response diagnostics in the gateway delivery path while keeping _normalize_empty_agent_response(...) unchanged by default for other callers
  • add regression coverage in tests/test_lazy_session_regressions.py for silent gateway-mode failed/partial empty turns

How to Test

  1. uv run --frozen --extra dev pytest -q -o addopts='' tests/test_lazy_session_regressions.py
  2. uv run --frozen ruff check gateway/run.py tests/test_lazy_session_regressions.py
  3. Confirm the new gateway-mode tests keep failed/partial empty responses silent while the existing helper tests still surface diagnostics by default.

Checklist

Code

  • I've read the Contributing Guide
  • My commit messages follow Conventional Commits (fix(scope):, feat(scope):, etc.)
  • I searched for existing PRs to make sure this isn't a duplicate
  • My PR contains only changes related to this fix/feature (no unrelated commits)
  • I've run pytest tests/ -q and all tests pass
  • I've added tests for my changes (required for bug fixes, strongly encouraged for features)
  • I've tested on my platform: macOS 15.x

Documentation & Housekeeping

  • I've updated relevant documentation (README, docs/, docstrings) — or N/A
  • I've updated cli-config.yaml.example if I added/changed config keys — or N/A
  • I've updated CONTRIBUTING.md or AGENTS.md if I changed architecture or workflows — or N/A
  • I've considered cross-platform impact (Windows, macOS) per the compatibility guide — or N/A
  • I've updated tool descriptions/schemas if I changed tool behavior — or N/A

Screenshots / Logs

  • uv run --frozen --extra dev pytest -q -o addopts='' tests/test_lazy_session_regressions.py -> 19 passed
  • uv run --frozen ruff check gateway/run.py tests/test_lazy_session_regressions.py -> All checks passed!

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/gateway Gateway runner, session dispatch, delivery labels May 11, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Thanks for isolating the gateway delivery concern. The branch needs substantial rework against current main.

Problems

  • gateway/run.py:2606-2643 deliberately turns empty failed and partial turns into actionable diagnostics, and the gateway invokes that path for every non-intentional-silence result at gateway/run.py:11611-11617. Suppressing all empty diagnostics would also hide real failures and recovery guidance.
  • Current main represents a valid no-op with exact successful control markers, not a blank result (gateway/response_filters.py:16-24, 73-79). The integration test at tests/gateway/test_gateway_silence_tokens.py:95-141 verifies both silent delivery suppression and transcript preservation.

Suggested changes

  • Rebase the design on the explicit successful silence-marker path and retain diagnostics for failed/partial/pre-processing-empty turns.
  • Test the complete gateway path rather than only _normalize_empty_agent_response.

Automated hermes-sweeper review.

@teknium1 teknium1 added sweeper:risk-message-delivery Sweeper risk: may drop, duplicate, misroute, or suppress messages 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-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.

Chat gateways should not send backend status/errors for empty responses

3 participants