Skip to content

The agent that grows with you

fix(memory): limit headless install consent to providers that left core

teknium10be2d562b06c
diff --git a/hermes_cli/memory_provider_migration.py b/hermes_cli/memory_provider_migration.py
index 3f46c8020ff..121a19e7ebc 100644
--- a/hermes_cli/memory_provider_migration.py
+++ b/hermes_cli/memory_provider_migration.py
@@ -25,6 +25,11 @@ logger = logging.getLogger(__name__)
_attempted: set[tuple[str, str]] = set()
+# Providers that shipped bundled in core. Unattended consent covers only these: their users already
+# accepted the deps when they picked the built-in. Any other catalog plugin named in memory.provider
+# (a synced config, a cloned profile) still needs an explicit install.
+_LEFT_CORE = frozenset({"hindsight", "honcho", "mem0", "supermemory", "openviking", "retaindb", "byterover", "holographic"})
+
def configured_provider(home: Path) -> str:
"""``memory.provider`` of *home*'s effective config, or ``""``."""
@@ -100,7 +105,7 @@ def _install_into(home: Path) -> Callable[[str], dict]:
token = set_hermes_home_override(home)
try:
return dashboard_install_plugin("", force=False, enable=True, catalog_name=name,
- assume_deps_consent=_unattended_consent())
+ assume_deps_consent=name in _LEFT_CORE and _unattended_consent())
finally:
reset_hermes_home_override(token)
return _install
diff --git a/tests/hermes_cli/test_memory_provider_migration.py b/tests/hermes_cli/test_memory_provider_migration.py
index 80875e34834..d655ff939b7 100644
--- a/tests/hermes_cli/test_memory_provider_migration.py
+++ b/tests/hermes_cli/test_memory_provider_migration.py
@@ -95,12 +95,13 @@ def test_startup_recovery_attempts_each_profile_home(tmp_path, monkeypatch):
assert installed == homes
[email protected](("tty", "lazy", "consent"), [
- (False, True, True), # Desktop/gateway/scripted update: nobody can answer the prompt
- (False, False, False), # allow_lazy_installs off: still refused, with the install hint
- (True, True, False), # a terminal: the user is asked
[email protected](("name", "tty", "lazy", "consent"), [
+ ("hindsight", False, True, True), # Desktop/gateway/scripted update: nobody can answer the prompt
+ ("hindsight", False, False, False), # allow_lazy_installs off: still refused, with the install hint
+ ("hindsight", True, True, False), # a terminal: the user is asked
+ ("someplugin", False, True, False), # never bundled: a config naming it is not consent to install it
])
-def test_unattended_migration_install_carries_lazy_install_consent(tmp_path, monkeypatch, tty, lazy, consent):
+def test_unattended_migration_install_carries_lazy_install_consent(tmp_path, monkeypatch, name, tty, lazy, consent):
"""Every provider still in core declares Python deps; without this, no non-interactive migration
(the whole point of the agent-start hook) can ever publish one."""
import io
@@ -117,6 +118,6 @@ def test_unattended_migration_install_carries_lazy_install_consent(tmp_path, mon
monkeypatch.setattr(pm_install, "lazy_installs_allowed", lambda: lazy)
seen = {}
monkeypatch.setattr(plugins_cmd, "dashboard_install_plugin", lambda *a, **kw: seen.update(kw) or {"ok": True})
- assert mig._install_into(tmp_path)("hindsight") == {"ok": True}
- assert seen["catalog_name"] == "hindsight"
+ assert mig._install_into(tmp_path)(name) == {"ok": True}
+ assert seen["catalog_name"] == name
assert seen.get("assume_deps_consent", False) is consent