Skip to content

The agent that grows with you

fix(config): a selected memory provider parked in plugins.disabled declares no live keys

Teknium35a7d34036e7
diff --git a/hermes_cli/config_runtime_keys.py b/hermes_cli/config_runtime_keys.py
index d1e67bc9904..cdaee2e7a27 100644
--- a/hermes_cli/config_runtime_keys.py
+++ b/hermes_cli/config_runtime_keys.py
@@ -56,10 +56,11 @@ def _selected_memory_provider_manifest():
name = cfg_get(load_config(), "memory", "provider")
if not isinstance(name, str) or not name.strip():
return None
- from plugins.memory import find_provider_dir
+ from plugins.memory import _explicitly_disabled, find_provider_dir
provider_dir = find_provider_dir(name.strip())
- if provider_dir is None:
+ # The memory loader refuses a provider parked in ``plugins.disabled``; its keys are not live either.
+ if provider_dir is None or _explicitly_disabled(name.strip(), provider_dir):
return None
manifest_file = next((f for f in (provider_dir / "plugin.yaml", provider_dir / "plugin.yml") if f.exists()), None)
return parse_manifest_file(manifest_file, provider_dir, "memory", "memory") if manifest_file else None
diff --git a/tests/hermes_cli/test_config_runtime_keys.py b/tests/hermes_cli/test_config_runtime_keys.py
index 79884504f23..985038bf02c 100644
--- a/tests/hermes_cli/test_config_runtime_keys.py
+++ b/tests/hermes_cli/test_config_runtime_keys.py
@@ -132,6 +132,8 @@ def test_selected_memory_provider_declares_its_config_keys(hermes_home, capsys):
assert _set_notice("memory.widgetmem.project", "p1", capsys) # installed, not selected
_write_config(hermes_home, {"memory": {"provider": "widgetmem"}})
assert not _set_notice("memory.widgetmem.project", "p2", capsys)
+ _write_config(hermes_home, {"memory": {"provider": "widgetmem"}, "plugins": {"disabled": ["widgetmem"]}})
+ assert _set_notice("memory.widgetmem.project", "p3", capsys) # selected but disabled
def test_enabled_project_plugin_declares_its_config_keys(hermes_home, tmp_path, monkeypatch, capsys):