From bd740f203b44237dbc5c27a2de4d86ef32af4dde Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 13 Jul 2026 04:21:33 -0700 Subject: [PATCH] test(approval): isolate smart observer redaction failure --- tests/tools/test_approval_plugin_hooks.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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)),