The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(plugins): a user-installed model provider reports enabled, as the loader treats it
Teknium6cd2817a6d6c
diff --git a/hermes_cli/plugins_cmd.py b/hermes_cli/plugins_cmd.pyindex 562601931c1..f878bbd76fb 100644--- a/hermes_cli/plugins_cmd.py+++ b/hermes_cli/plugins_cmd.py@@ -738,17 +738,18 @@ def _is_portable_plugin_dir(dir_path) -> bool:_BUNDLED_DEFAULT_ON_KINDS = frozenset({"backend", "platform", "model-provider"})-def _bundled_default_on(dir_path) -> bool:- """True when a bundled plugin is active without a ``plugins.enabled`` entry (portable- ``plugin.json`` packages have no kind, so never)."""+def _default_on(dir_path, source: str) -> bool:+ """True when a plugin is active without a ``plugins.enabled`` entry (portable ``plugin.json``+ packages have no kind, so never). Model providers load through providers/ discovery from any+ source (``gate_manifest``); the other default-on kinds only when bundled."""manifest_file = _native_manifest_file(Path(dir_path))if manifest_file is None:return Falsetry:kind = str(_load_yaml_manifest(manifest_file).get("kind", "standalone")).strip().lower()- return kind in _BUNDLED_DEFAULT_ON_KINDSexcept Exception:return False+ return kind == "model-provider" or (source == "bundled" and kind in _BUNDLED_DEFAULT_ON_KINDS)def _scan_level(base: Path, source: str, skip_names: set, prefix: str, depth: int, seen: dict) -> None:@@ -810,14 +811,14 @@ def _plugin_status(name: str, enabled: set, disabled: set, key: str = "", *, soudir_path=None, active: "frozenset | set" = frozenset()) -> str:"""User-facing activation state for a plugin name or key. Mirrors ``gate_manifest``: an explicitdisable wins, then the allow-list, then the activations that need no list entry — bundled- backends/platforms/model providers (*source* + *dir_path*) and category-selected providers+ backends/platforms and model providers from any source (*source* + *dir_path*) and category-selected providers(*active*, see :func:`_category_active_names`)."""names = {name, key}if names & disabled:return "disabled"if names & enabled or names & active:return "enabled"- if source == "bundled" and dir_path is not None and _bundled_default_on(dir_path):+ if dir_path is not None and _default_on(dir_path, source):return "enabled"return "not enabled"diff --git a/tests/hermes_cli/test_plugins_cmd_activation_keys.py b/tests/hermes_cli/test_plugins_cmd_activation_keys.pyindex efadcf2d2f8..3d9a26f322b 100644--- a/tests/hermes_cli/test_plugins_cmd_activation_keys.py+++ b/tests/hermes_cli/test_plugins_cmd_activation_keys.py@@ -104,3 +104,21 @@ def test_status_reports_bundled_defaults_and_the_live_memory_provider(home):# An explicit disable still wins over both defaults.assert plugins_cmd._plugin_status("fakemem", enabled, {"fakemem"}, key="fakemem", source="user",active=active) == "disabled"+++def test_status_matches_the_loader_for_a_user_installed_model_provider(home):+ """``gate_manifest`` loads a model provider from any source without a ``plugins.enabled`` entry, so+ status (and the Desktop Plugins switch) must not report a user-installed one as "not enabled"; a+ user standalone plugin stays opt-in."""+ _write_plugin(home / "plugins", "fakeprov", "fakeprov", "kind: model-provider\n")+ _write_plugin(home / "plugins", "fakestand", "fakestand", "")+ enabled, disabled = plugins_cmd._get_enabled_set(), plugins_cmd._get_disabled_set()+ by_key = {e[5]: e for e in plugins_cmd._discover_all_plugins()}+ status = {}+ for key in ("fakeprov", "fakestand"):+ name, _v, _d, source, dir_path, _k = by_key[key]+ status[key] = plugins_cmd._plugin_status(name, enabled, disabled, key=key, source=source, dir_path=dir_path)+ assert status == {"fakeprov": "enabled", "fakestand": "not enabled"}+ name, _v, _d, source, dir_path, _k = by_key["fakeprov"]+ assert plugins_cmd._plugin_status(name, enabled, {"fakeprov"}, key="fakeprov", source=source,+ dir_path=dir_path) == "disabled"