diff --git a/tests/agent/test_redact.py b/tests/agent/test_redact.py index 27098ee6d..6b7cfa586 100644 --- a/tests/agent/test_redact.py +++ b/tests/agent/test_redact.py @@ -12,6 +12,8 @@ from agent.redact import redact_sensitive_text, RedactingFormatter def _ensure_redaction_enabled(monkeypatch): """Ensure HERMES_REDACT_SECRETS is not disabled by prior test imports.""" monkeypatch.delenv("HERMES_REDACT_SECRETS", raising=False) + # Also patch the module-level snapshot so it reflects the cleared env var + monkeypatch.setattr("agent.redact._REDACT_ENABLED", True) class TestKnownPrefixes: