From 42c30985c75cdc8f6c964f0d4a68f085f9278b54 Mon Sep 17 00:00:00 2001 From: Teknium Date: Mon, 20 Apr 2026 05:11:15 -0700 Subject: [PATCH] fix: enable plugins in config.yaml for lazy-discovery tests The opt-in-by-default change (70111eea) requires plugins to be listed in plugins.enabled. The cherry-picked test fixtures didn't write this config, so two tests failed on current main. --- tests/hermes_cli/test_commands.py | 4 ++++ tests/hermes_cli/test_plugins.py | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/hermes_cli/test_commands.py b/tests/hermes_cli/test_commands.py index 2f92ecbb1..49e114aef 100644 --- a/tests/hermes_cli/test_commands.py +++ b/tests/hermes_cli/test_commands.py @@ -702,6 +702,10 @@ class TestTelegramMenuCommands: "def register(ctx):\n" " ctx.register_command('lcm', lambda args: 'ok', description='LCM status and diagnostics')\n" ) + # Opt-in: plugins are opt-in by default, so enable in config.yaml + (tmp_path / "config.yaml").write_text( + "plugins:\n enabled:\n - cmd-plugin\n" + ) monkeypatch.setenv("HERMES_HOME", str(tmp_path)) with patch.object(plugins_mod, "_plugin_manager", None): diff --git a/tests/hermes_cli/test_plugins.py b/tests/hermes_cli/test_plugins.py index df7ba6555..9433ecdca 100644 --- a/tests/hermes_cli/test_plugins.py +++ b/tests/hermes_cli/test_plugins.py @@ -831,7 +831,8 @@ class TestPluginCommands: def test_get_plugin_context_engine_discovers_plugins_lazily(self, tmp_path, monkeypatch): """Context engine lookup should work before any explicit discover_plugins() call.""" - plugins_dir = tmp_path / "hermes_test" / "plugins" + hermes_home = tmp_path / "hermes_test" + plugins_dir = hermes_home / "plugins" plugin_dir = plugins_dir / "engine-plugin" plugin_dir.mkdir(parents=True, exist_ok=True) (plugin_dir / "plugin.yaml").write_text( @@ -856,7 +857,11 @@ class TestPluginCommands: "def register(ctx):\n" " ctx.register_context_engine(StubEngine())\n" ) - monkeypatch.setenv("HERMES_HOME", str(tmp_path / "hermes_test")) + # Opt-in: plugins are opt-in by default, so enable in config.yaml + (hermes_home / "config.yaml").write_text( + yaml.safe_dump({"plugins": {"enabled": ["engine-plugin"]}}) + ) + monkeypatch.setenv("HERMES_HOME", str(hermes_home)) import hermes_cli.plugins as plugins_mod