diff --git a/agent.py b/agent.py index 928a41d..4715520 100644 --- a/agent.py +++ b/agent.py @@ -763,7 +763,7 @@ def redact_secrets(text: str) -> str: r"ghp_[A-Za-z0-9]{12,}", ] for pattern in patterns: - redacted = re.sub(pattern, lambda m: (m.group(1) if m.lastindex else "") + "[REDACTED]", redacted) + redacted = re.sub(pattern, _redact_match, redacted) return redacted