The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(plugins): only a real memory-provider tree selects memory.provider on install
Teknium59224a20f052
diff --git a/hermes_cli/plugins_cmd_install.py b/hermes_cli/plugins_cmd_install.pyindex acc33eb0ddf..82241111d5b 100644--- a/hermes_cli/plugins_cmd_install.py+++ b/hermes_cli/plugins_cmd_install.py@@ -563,8 +563,9 @@ def cmd_install(if no_deps:console.print("[dim]--no-deps: skipping dependency consent; the plugin stays disabled.[/dim]")# A memory provider activates through memory.provider alone; the loader never reads plugins.enabled.+ # Decide from the installed tree: catalog category "memory" also holds hooks, context engines and skills.from plugins.memory import _is_memory_provider_dir- is_memory_provider = (entry.category == "memory") if entry is not None else _is_memory_provider_dir(target)+ is_memory_provider = _is_memory_provider_dir(target)if should_enable is None and not already_active:should_enable = _pc()._is_tty() and _pc()._ask_yes(f" Use '{installed_name}' as the memory provider now? [y/N]: " if is_memory_provider@@ -636,15 +637,22 @@ def _select_memory_provider(name: str, console, *, select: bool) -> None:f"(or set memory.provider: {name}) to use it.[/dim]")returnfrom hermes_cli.memory_setup import prepare_memory_provider_dependencies+ from plugins.memory import find_provider_dir+ if find_provider_dir(name) is None: # never save a provider name the loader cannot resolve+ console.print(f"[red]✗[/red] {name} does not resolve as a memory provider; memory.provider is unchanged.")+ returntry:prepare_memory_provider_dependencies(name)except Exception as exc: # resolver conflict, network, PM refusal: report, leave the selection alone+ logger.debug("memory provider %s dependency preparation failed", name, exc_info=True)console.print(f"[red]✗[/red] Could not prepare {name}'s dependencies: {exc}")console.print("[dim]memory.provider is unchanged; run `hermes memory setup` after resolving it.[/dim]")return+ previous = _pc()._get_current_memory_provider()_pc()._save_memory_provider(name)console.print(- f"[green]✓[/green] [bold]{name}[/bold] set as memory.provider. "+ f"[green]✓[/green] [bold]{name}[/bold] set as memory.provider"+ f"{f' (replacing {previous})' if previous and previous != name else ''}. "f"Run `hermes memory setup {name}` to configure it; new sessions use it.")diff --git a/tests/hermes_cli/test_plugins_cmd_catalog.py b/tests/hermes_cli/test_plugins_cmd_catalog.pyindex c00bea3e7e6..bdf0a3c00b4 100644--- a/tests/hermes_cli/test_plugins_cmd_catalog.py+++ b/tests/hermes_cli/test_plugins_cmd_catalog.py@@ -332,14 +332,17 @@ def test_kill_list_covers_update_enable_and_load_of_an_installed_plugin(world, tassert gate_manifest(manifest, set(), {"killed"}).action == "load"[email protected]("enable", [True, False])-def test_memory_category_install_activates_via_memory_provider_not_plugins_enable(world, monkeypatch, enable):- """A category:memory install activates through memory.provider alone — the loader never consults[email protected]("provider,enable", [(True, True), (True, False), (False, True)])+def test_memory_category_install_activates_via_memory_provider_not_plugins_enable(world, monkeypatch,+ provider, enable):+ """A memory provider activates through memory.provider alone — the loader never consultsplugins.enabled — so "Enable now?" must select the provider, and a decline must point at- `hermes memory setup`, never at the dead-end `plugins enable` hint."""+ `hermes memory setup`, never at the dead-end `plugins enable` hint. Catalog category "memory" also+ holds hook plugins: those enable normally and leave the user's memory.provider alone."""repo = world["repo"]- (repo / "__init__.py").write_text("def register_memory_provider(ctx):\n pass\n")- world["state"]["pin"] = _commit(repo, "memory provider contract")+ (repo / "__init__.py").write_text("def register_memory_provider(ctx):\n pass\n" if provider+ else "def register(ctx):\n ctx.register_hook('pre_llm_call', print)\n")+ world["state"]["pin"] = _commit(repo, "memory category plugin")def _memory_entries():return [pc_cat.PluginCatalogEntry(name="cat-plugin", repo=repo.as_uri(), sha=world["state"]["pin"],@@ -354,6 +357,11 @@ def test_memory_category_install_activates_via_memory_provider_not_plugins_enablmonkeypatch.setattr(pc, "_console",lambda: type("C", (), {"print": staticmethod(_capture)})())+ if not provider:+ pc._save_memory_provider("honcho")+ pc.cmd_install("cat-plugin", enable=enable)+ assert (pc._get_current_memory_provider(), pc._get_enabled_set()) == ("honcho", {"cat-plugin"})+ returnpc.cmd_install("cat-plugin", enable=enable)assert pc._get_current_memory_provider() == ("cat-plugin" if enable else "")assert pc._get_enabled_set() == set()diff --git a/website/docs/user-guide/features/plugins.md b/website/docs/user-guide/features/plugins.mdindex 7312ce939b6..62f2f1278c3 100644--- a/website/docs/user-guide/features/plugins.md+++ b/website/docs/user-guide/features/plugins.md@@ -190,7 +190,7 @@ hermes plugins enable <name> # add to allow-listhermes plugins disable <name> # remove from allow-list + add to disabled```-After `hermes plugins install owner/repo`, you're asked `Enable 'name' now? [y/N]` — defaults to no. Skip the prompt for scripted installs with `--enable` or `--no-enable`. A memory provider (catalog `category: memory`) asks `Use 'name' as the memory provider now?` instead: yes (or `--enable`) sets `memory.provider`, which is the only switch that activates a provider; no leaves it for `hermes memory setup`.+After `hermes plugins install owner/repo`, you're asked `Enable 'name' now? [y/N]` — defaults to no. Skip the prompt for scripted installs with `--enable` or `--no-enable`. A memory provider (a plugin whose `__init__.py` registers a `MemoryProvider`) asks `Use 'name' as the memory provider now?` instead: yes (or `--enable`) sets `memory.provider`, which is the only switch that activates a provider; no leaves it for `hermes memory setup`.For a reproducible install, pin a full immutable commit (tags, branches, andabbreviated SHAs are not accepted):