mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-07-01 12:02:05 +00:00
fix(gateway): suppress compression status noise on Discord and other chats (#39293)
Extend the gateway noisy-status filter beyond Telegram so internal compression lifecycle messages stay in logs instead of spamming Discord, Slack, and other messaging channels.
This commit is contained in:
parent
9f7d520caf
commit
d2ea948bc0
1 changed files with 7 additions and 2 deletions
|
|
@ -70,7 +70,7 @@ _ADAPTER_DISCONNECT_TIMEOUT_SECS_DEFAULT = 5.0
|
|||
_TELEGRAM_COMMAND_MENTION_RE = re.compile(r"(?<![\w:/])/([A-Za-z0-9][A-Za-z0-9_-]*)")
|
||||
|
||||
_TELEGRAM_NOISY_STATUS_RE = re.compile(
|
||||
r"(" # transient/auxiliary status that should stay in logs, not Telegram chat
|
||||
r"(" # transient/auxiliary status that should stay in logs, not gateway chats
|
||||
r"auxiliary\s+.+\s+failed"
|
||||
r"|compression\s+summary\s+failed"
|
||||
r"|fallback\s+context\s+marker"
|
||||
|
|
@ -79,6 +79,7 @@ _TELEGRAM_NOISY_STATUS_RE = re.compile(
|
|||
r"|auto-lowered\s+compression\s+threshold"
|
||||
r"|compacting\s+context\s+[—-]\s+summarizing\s+earlier\s+conversation"
|
||||
r"|preflight\s+compression"
|
||||
r"|session\s+compressed\s+\d+\s+times"
|
||||
r"|rate\s+limited\.\s+waiting\s+\d"
|
||||
r"|retrying\s+in\s+\d"
|
||||
r"|max\s+retries\s+\(\d+\).*(?:trying\s+fallback|exhausted|invalid\s+responses)"
|
||||
|
|
@ -429,7 +430,11 @@ def _sanitize_gateway_final_response(platform: Any, text: str) -> str:
|
|||
|
||||
|
||||
def _prepare_gateway_status_message(platform: Any, event_type: str, message: str) -> Optional[str]:
|
||||
"""Filter/sanitize agent status callbacks before platform delivery."""
|
||||
"""Filter/sanitize agent status callbacks before platform delivery.
|
||||
|
||||
Local/CLI sessions keep the raw diagnostic stream. Messaging gateway
|
||||
surfaces should not receive transient auxiliary/compression chatter.
|
||||
"""
|
||||
text = str(message or "").strip()
|
||||
if not text:
|
||||
return None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue