diff --git a/tests/tools/test_approval_plugin_hooks.py b/tests/tools/test_approval_plugin_hooks.py index 2b9640b45787..5493d274da00 100644 --- a/tests/tools/test_approval_plugin_hooks.py +++ b/tests/tools/test_approval_plugin_hooks.py @@ -284,8 +284,14 @@ class TestSmartModeFiresHooks: ): self._configure(monkeypatch, verdict) captured = [] + + def fail_observer_redaction(text, *, force=False): + if force: + raise RuntimeError("observer redactor failed") + return text + with ( - patch("agent.redact.redact_sensitive_text", side_effect=RuntimeError("redactor failed")), + patch("agent.redact.redact_sensitive_text", side_effect=fail_observer_redaction), patch( "hermes_cli.plugins.invoke_hook", side_effect=lambda name, **kwargs: captured.append((name, kwargs)),