Skip to content

The agent that grows with you

refactor(context): drop redundant or-empty before redaction

kshitijk4poor062dc1e7f0f5
diff --git a/agent/context_compressor.py b/agent/context_compressor.py
index 41d895a3bae..6809eb216bc 100644
--- a/agent/context_compressor.py
+++ b/agent/context_compressor.py
@@ -3401,7 +3401,7 @@ class ContextCompressor(SummaryDispatchMixin, MicroCompactionMixin, ContextEngin
fn = tc.get("function", {})
# Redact the FULL args before cutting: delimited secrets (PEM BEGIN…END) only match whole, so a
# pre-redaction cut would leave a key body straddling the cut unredacted in the persisted summary.
- args = _redact_compaction_text(fn.get("arguments", "") or "")
+ args = _redact_compaction_text(fn.get("arguments", ""))
if len(args) > self._TOOL_ARGS_MAX:
args = args[:self._TOOL_ARGS_HEAD] + "..."
return f" {fn.get('name', '?')}({args})"