From f98b223b58c477e4596ece384bef248321a6fdfb Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Tue, 28 Jul 2026 23:36:26 -0700 Subject: [PATCH] test: accept path= kwarg in global shutil.which stubs _has_agent_browser()'s new managed-Node rung calls shutil.which('agent-browser', path=...); tests that monkeypatch shutil.which globally with 1-arg lambdas raised TypeError when their code path reached the browser readiness probe (test_post_setup_gating, test_setup_model_provider). --- tests/hermes_cli/test_post_setup_gating.py | 4 ++-- tests/hermes_cli/test_setup_model_provider.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/hermes_cli/test_post_setup_gating.py b/tests/hermes_cli/test_post_setup_gating.py index 778a2a683b3..dea16e42253 100644 --- a/tests/hermes_cli/test_post_setup_gating.py +++ b/tests/hermes_cli/test_post_setup_gating.py @@ -21,7 +21,7 @@ class TestPostSetupGate: from hermes_cli import tools_config monkeypatch.setenv("HERMES_HOME", str(tmp_path)) - monkeypatch.setattr(tools_config.shutil, "which", lambda name: None) + monkeypatch.setattr(tools_config.shutil, "which", lambda name, path=None: None) assert tools_config._toolset_needs_configuration_prompt( "computer_use", {} @@ -36,7 +36,7 @@ class TestPostSetupGate: monkeypatch.setattr( tools_config.shutil, "which", - lambda name: "/usr/local/bin/cua-driver" if name == "cua-driver" else None, + lambda name, path=None: "/usr/local/bin/cua-driver" if name == "cua-driver" else None, ) assert tools_config._toolset_needs_configuration_prompt( diff --git a/tests/hermes_cli/test_setup_model_provider.py b/tests/hermes_cli/test_setup_model_provider.py index b9db444ddc7..b58d55d063d 100644 --- a/tests/hermes_cli/test_setup_model_provider.py +++ b/tests/hermes_cli/test_setup_model_provider.py @@ -279,7 +279,7 @@ def test_setup_summary_marks_anthropic_auth_as_vision_available(tmp_path, monkey monkeypatch.setenv("HERMES_HOME", str(tmp_path)) _clear_provider_env(monkeypatch) monkeypatch.setenv("ANTHROPIC_API_KEY", "sk-ant-api03-key") - monkeypatch.setattr("shutil.which", lambda _name: None) + monkeypatch.setattr("shutil.which", lambda _name, path=None: None) monkeypatch.setattr("agent.auxiliary_client.get_available_vision_backends", lambda: ["anthropic"]) _print_setup_summary(load_config(), tmp_path)