fix(gateway): quiet noisy Telegram errors and sanitize provider failures - #28533
Merged
Conversation
Contributor
🔎 Lint report:
|
14 tasks
kshitijk4poor
pushed a commit
that referenced
this pull request
Jun 26, 2026
…eways, not just Telegram (#39293) The Telegram noise/secret filter added in #28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
pai-scaffolde
pushed a commit
to pai-scaffolde/hermes-agent
that referenced
this pull request
Jun 28, 2026
…eways, not just Telegram (NousResearch#39293) The Telegram noise/secret filter added in NousResearch#28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
…eways, not just Telegram (NousResearch#39293) The Telegram noise/secret filter added in NousResearch#28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
…eways, not just Telegram (NousResearch#39293) The Telegram noise/secret filter added in NousResearch#28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
…eways, not just Telegram (NousResearch#39293) The Telegram noise/secret filter added in NousResearch#28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
…eways, not just Telegram (NousResearch#39293) The Telegram noise/secret filter added in NousResearch#28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
jeffreyhlin
added a commit
to jeffreyhlin/hermes-agent
that referenced
this pull request
Aug 3, 2026
Rebasing onto current main surfaced two real defects in the guard pipeline commit: 1. _provider_error_guard was still Telegram-gated, a leftover from when _sanitize_gateway_final_response only covered Telegram. Upstream widened that security invariant to every chat surface (NousResearch#28533 -> NousResearch#39293), so WhatsApp/Slack/Signal/Matrix would have leaked raw provider error envelopes (which can carry bearer tokens). The guard now applies to every surface reaching it; programmatic surfaces are already excluded by _GATEWAY_RAW_TEXT_PLATFORMS upstream of the call. 2. The test fixture leaked the opt-in em-dash guard into unrelated tests via the module-level pipeline singleton. Env flags are now cleared before the reset on both setup and teardown. Also relaxes the secret-redaction assertion to test the behaviour contract (raw credential does not survive) instead of a specific mask marker, since the authoritative agent.redact redactor masks with '***' while the gateway fallback uses '[REDACTED]'.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
…eways, not just Telegram (NousResearch#39293) The Telegram noise/secret filter added in NousResearch#28533 gated its work on `_gateway_platform_value(platform) != "telegram"`, so `_sanitize_gateway_final_response` and `_prepare_gateway_status_message` only ran for Telegram. Every other human-facing chat surface (WhatsApp, Discord, Slack, Signal, Matrix, plugin platforms, etc.) received raw provider-error bodies verbatim — including any leaked credentials the secret-redaction pass (`sk-…`, `Bearer …`, `gh[pousr]_…`, `xox[baprs]-…`, `hf_…`, `glpat-…`) was meant to strip. Invert the gate from a one-platform allowlist into a small programmatic-surface denylist: only `local`, `api_server`, `webhook`, and `msgraph_webhook` consume gateway text programmatically and keep raw status/error text. Every other (chat) surface — including unknown/empty platform values and on-demand plugin pseudo-members — fails closed to the redacted, noise-filtered, sanitized path. This widens the same root-cause fix to both call sites: status callbacks and final replies.
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.
Salvage of #24014 (@houenyang-momo). Adds Telegram-specific gateway filtering for noisy lifecycle/status callbacks (auxiliary title/compression failures, retry backoff chatter). Sanitizes Telegram-facing provider/API failures so raw HTTP bodies, policy/security text, request IDs, and key-like values aren't sent to chat. Suppressed callbacks still logged with secret redaction.
Conflict resolution: combined the new
_prepare_gateway_status_messagefilter with the just-mergedsafe_schedule_threadsafescheduler pattern (HEAD).Authorship preserved via cherry-pick. 38/38 noise-filter + display-config tests passing.