fix: suppress internal status banners on customer-facing platforms (refs #28208) - #30574
Open
ozzaii wants to merge 1 commit into
Open
fix: suppress internal status banners on customer-facing platforms (refs #28208)#30574ozzaii wants to merge 1 commit into
ozzaii wants to merge 1 commit into
Conversation
…ousResearch#28208) Compression-recovery emissions like "🗜️ Context too large (~156k tokens) — compressing (1/3)..." were reaching end-user chat threads on WhatsApp, Slack, Signal, Telegram and Discord because ``AIAgent._emit_status`` dispatches via ``status_callback`` directly, bypassing the ``transform_llm_output`` plugin hook that sanitiser plugins commonly attach to. Add a ``customer_facing: bool = True`` kwarg to ``_emit_status``. When the runtime ``platform`` is in the customer-facing set and either: * ``customer_facing=False`` is passed explicitly, or * the message starts with an internal-status glyph in the (narrow, compression-only) defensive fallback list, the gateway dispatch is skipped. CLI / admin / api surfaces still receive every status through ``_vprint``, preserving full diagnostic visibility for operators. Annotates the four compression-recovery emit sites — 1× 413 payload, 1× context-too-large, 2× compressed-retrying — with the explicit kwarg so future audits surface the policy in code instead of relying on the glyph fallback. Refs: NousResearch#28208 (partial fix — compression-banner category only; broader "silent-success" / empty-response / retry-banner suppression and the config-level ``whatsapp.allow_silent_response`` proposed in the issue are deliberately out of scope here, to keep this PR small enough to review and merge quickly). Tests ----- * ``tests/run_agent/test_emit_status_customer_facing_filter.py`` — 13 cases covering all five customer-facing platforms, the glyph fallback, the explicit kwarg path, CLI / api admin visibility, and ``status_callback`` exception safety. * Existing ``test_empty_response_emits_status_for_gateway`` and ``test_context_compression_triggered`` still pass — backward compatibility preserved for callers that omit the new kwarg.
This was referenced May 26, 2026
|
This seems great, but it does seems to be separate from #18848 since AFAIK the gateway will nudge the model to spit out a response even if status banners aren't dumped into the platform. Also I would like the option to see status banners elsewhere. Perhaps home channel or another interface so that admins or the owner of the hermes setup can be notified/see the logs or info lost from the status banner info. Just not appropriate for non admins to see this. |
Contributor
|
Thanks for isolating a real customer-facing failure mode. The current main architecture has moved the relevant logic, so this needs a small re-scope rather than a direct cherry-pick. Problems
Suggested changes
Automated hermes-sweeper review. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Partial fix for #28208. The WhatsApp gateway (and any other customer-facing
platform) currently delivers Hermes-internal diagnostic banners straight
into end-user chat threads — for example:
Root cause:
AIAgent._emit_statusdispatches to the gateway adapter viastatus_callbackdirectly, which bypasses thetransform_llm_outputplugin hook that sanitiser plugins typically attach to.
This PR adds a platform-aware filter to
_emit_status:customer_facing: bool = Truekwarg (backwards-compatible default)._CUSTOMER_FACING_PLATFORMS = {whatsapp, slack, signal, telegram, discord}._INTERNAL_STATUS_PREFIXESdefensive glyph fallback — kept narrow(compression-banner category only).
too-large, 2× compressed-retrying) now opt out explicitly with
customer_facing=False.visibility unchanged.
Why "partial"
#28208 also requests silent-success for empty responses, broader provider-
diagnostic suppression, and a
whatsapp.allow_silent_responseconfig flag.Those are deferred to follow-ups so this PR stays small enough to review
and land quickly. The compression-banner scope was chosen because:
(live incident 2026-05-22 in an AIRA-on-Hermes deployment), so the
marginal value is highest.
behavioural impact on CLI / API surfaces, no public-API breakage.
Test plan
tests/run_agent/test_emit_status_customer_facing_filter.py— 13new cases covering:
customer_facing=Falsecustomer_facing=Falsedrops even non-glyph messagesstatus_callbackexceptions remain swallowed (fault-tolerance kept)test_empty_response_emits_status_for_gatewaystill passes.test_context_compression_triggeredstill passes.Out of scope (follow-up PRs)
Tracked under #28208 — happy to take any of these in this PR if the
maintainers prefer a wider scope:
whatsapp.allow_silent_response: true/suppress_diagnostics: trueconfig flag wiring.
retry (
⚠️ Empty/malformed), rate-limit (⏱️/⚠️/❌), retrying (⏳),max-retries (
⚠️/❌), non-retryable (⚠️), provider-auth (⚠️),proxy (
⚠️). My local deployment ships these in the glyph fallbackfor defensive coverage, but each touches an additional set of emit
sites and felt big enough to deserve its own review.