From de26b178548618364f1947ada93b2efefd8c39b8 Mon Sep 17 00:00:00 2001 From: teknium1 <127238744+teknium1@users.noreply.github.com> Date: Wed, 3 Jun 2026 06:23:28 -0700 Subject: [PATCH] test: stub has_hook in transform_tool_result hook tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI slice 3 caught that tests/test_transform_tool_result_hook.py monkeypatches invoke_hook but not has_hook, so the new has_hook("transform_tool_result") gate skipped the emit and the transform never ran. Stub has_hook=True in the shared _run_handle_function_call helper whenever a custom invoke_hook is supplied (the test intends hooks to fire). The no-hook-registered test keeps the real has_hook=False path — that's the gate's intended behavior. --- tests/test_transform_tool_result_hook.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_transform_tool_result_hook.py b/tests/test_transform_tool_result_hook.py index 1b4146422..49497706a 100644 --- a/tests/test_transform_tool_result_hook.py +++ b/tests/test_transform_tool_result_hook.py @@ -36,6 +36,10 @@ def _run_handle_function_call( if invoke_hook is not _UNSET: # Patch the symbol actually imported inside handle_function_call. monkeypatch.setattr("hermes_cli.plugins.invoke_hook", invoke_hook) + # Supplying a custom invoke_hook means the test expects hooks to + # fire — make has_hook agree so the has_hook gate doesn't skip the + # post_tool_call / transform_tool_result emit paths. + monkeypatch.setattr("hermes_cli.plugins.has_hook", lambda name: True) return model_tools.handle_function_call( tool_name,