The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(plugins): memory provider setup lists the dependencies PM would install
ethernet00373b537616
diff --git a/hermes_cli/web_server_memory.py b/hermes_cli/web_server_memory.pyindex f2ce274ab29..db4a7983834 100644--- a/hermes_cli/web_server_memory.py+++ b/hermes_cli/web_server_memory.py@@ -48,8 +48,11 @@ def _string_list(value: Any) -> List[str]:def _memory_provider_setup_manifest(name: str) -> tuple[dict, dict]:from hermes_cli.memory_setup import memory_provider_dependency_inputs+ from plugins.memory import find_provider_dir+ from pm.plugin_declarations import read_python_declarationmanifest, inputs = memory_provider_dependency_inputs(name)+ plugin_dir = find_provider_dir(name)external_dependencies: List[Dict[str, str]] = []for raw in manifest.get("external_dependencies") or []:if not isinstance(raw, dict):@@ -58,9 +61,9 @@ def _memory_provider_setup_manifest(name: str) -> tuple[dict, dict]:if any(dep.values()):external_dependencies.append(dep)return {- # Display only; neither import names nor these labels determine readiness.- "pip_dependencies": list(dict.fromkeys(- _string_list(manifest.get("pip_dependencies")) + _string_list(manifest.get("python_dependencies")))),+ # Display only; neither import names nor these labels determine readiness. Shown from the+ # same declaration PM installs (an authored pyproject.toml wins over the manifest lists).+ "pip_dependencies": list(read_python_declaration(plugin_dir).install_requirements) if plugin_dir else [],"python_dependencies_declared": bool(inputs),"external_dependencies": external_dependencies,"required_env": _string_list(manifest.get("requires_env")),diff --git a/tests/hermes_cli/test_web_memory_provider_setup_install.py b/tests/hermes_cli/test_web_memory_provider_setup_install.pyindex 7caea72a02a..6d725518303 100644--- a/tests/hermes_cli/test_web_memory_provider_setup_install.py+++ b/tests/hermes_cli/test_web_memory_provider_setup_install.py@@ -137,4 +137,18 @@ def test_malformed_candidate_manifest_is_not_a_successful_noop(tmp_path, monkeyp(tmp_path / "plugin.yaml").write_text('name: [unterminated\n')monkeypatch.setattr("plugins.memory.find_provider_dir", lambda name: tmp_path)[row] = mp._install_memory_provider_python_dependencies("broken")- assert row["status"] == "failed"\ No newline at end of file+ assert row["status"] == "failed"+[email protected]("manifest_lists", [False, True])+def test_setup_lists_the_requirements_pm_would_install(tmp_path, monkeypatch, manifest_lists):+ """An authored pyproject.toml wins over the manifest lists, so it is what the setup UI must show."""+ (tmp_path / "plugin.yaml").write_text(json.dumps({+ "name": "provider", **({"pip_dependencies": ["stale-manifest-dep"]} if manifest_lists else {}),+ }))+ (tmp_path / "pyproject.toml").write_text(+ '[project]\nname = "provider"\nversion = "1"\ndependencies = ["provider_dep>=1,<2", "hermes-agent"]\n')+ monkeypatch.setattr("plugins.memory.find_provider_dir", lambda name: tmp_path)+ monkeypatch.setattr("pm.venv_is_current", lambda **inputs: True)+ from hermes_cli.web_server_memory import _memory_provider_setup_info++ assert _memory_provider_setup_info("provider")["pip_dependencies"] == ["provider_dep>=1,<2"]