From e844ea9f0b25cb23e3b73d0a6b7f619137162403 Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Thu, 16 Jul 2026 13:33:06 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20follow-up=20for=20salvaged=20PR=20#65187?= =?UTF-8?q?=20=E2=80=94=20add=20missing=20compression=5Fstate=20to=205th?= =?UTF-8?q?=20call=20site,=20force-redact=20error=20text=20at=20gateway=20?= =?UTF-8?q?boundaries?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gateway/run.py | 5 +++++ gateway/slash_commands.py | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/gateway/run.py b/gateway/run.py index 37c4718d80b9..54baeae9b20d 100644 --- a/gateway/run.py +++ b/gateway/run.py @@ -11603,6 +11603,11 @@ class GatewayRunner(GatewayAuthorizationMixin, GatewayKanbanWatchersMixin, Gatew _comp = getattr(_hyg_agent, "context_compressor", None) if _comp is not None and getattr(_comp, "_last_compress_aborted", False): _err = getattr(_comp, "_last_summary_error", None) or "unknown error" + # Force-redact: provider exception text + # may contain credentials; this message + # reaches gateway users directly. + from agent.redact import redact_sensitive_text + _err = redact_sensitive_text(_err, force=True) _warn_msg = ( "⚠️ Context compression aborted " f"({_err}). No messages were dropped — " diff --git a/gateway/slash_commands.py b/gateway/slash_commands.py index ad61284f6a73..682d1431028c 100644 --- a/gateway/slash_commands.py +++ b/gateway/slash_commands.py @@ -3345,6 +3345,7 @@ class GatewaySlashCommandsMixin: compressed, approx_tokens, new_tokens, + compression_state=compressor, ) # Detect summary-generation failure so we can surface a # visible warning to the user even on the manual /compress @@ -3355,6 +3356,11 @@ class GatewaySlashCommandsMixin: # passed above so any active cooldown is bypassed. _summary_aborted = bool(getattr(compressor, "_last_compress_aborted", False)) _summary_err = getattr(compressor, "_last_summary_error", None) + # Force-redact provider exception text at this UI boundary + # even when global redaction is disabled. + if _summary_err: + from agent.redact import redact_sensitive_text + _summary_err = redact_sensitive_text(_summary_err, force=True) # Separately: did the user's CONFIGURED aux model fail # and we recovered via main? Surface that as an info # note so they can fix their config.