Files
hermes-agent/tests/plugins/test_plugin_paths_follow_profile.py
teknium1 781334eea4 chore(memory): remove the bundled mem0 provider (moved to the plugin catalog)
plugin-catalog/mem0.yaml (#131267) points at mem0ai/mem0's own
integrations/hermes-plugin-mem0 at a reviewed pin. The entry stays dormant
while a bundled copy exists (bundled providers win in find_provider_dir), so
deleting the in-tree copy is what lets hermes_cli/memory_provider_migration.py
install it for every home whose memory.provider is "mem0". The vendor copy
keeps the provider name, mem0.json, the MEM0_* keys and the setup wizard.

Also dropped: the hermes-agent[mem0] extra, its win-arm64 platform row and
exclude-newer row, the pm/extras.py anchor (uv lock removes only mem0ai,
posthog, qdrant-client and sqlalchemy), the mem0-specific doctor check (the
generic check now names `hermes plugins install mem0`), and the tests that
imported plugins.memory.mem0. Prose that lists the bundled set now names mem0
as a catalog provider. MEM0_* env hints and redaction stay: the catalog copy
still reads them.
2026-10-06 05:50:08 -07:00

45 lines
1.6 KiB
Python

"""Plugin data paths follow the active profile's HERMES_HOME, including the ContextVar override.
Several plugins carried a ``~/.hermes`` fallback (guarding an ImportError of ``hermes_constants``
that cannot happen for a bundled plugin) or resolved the home at import time. Both are wrong on
Windows and under multiplex profile overrides. Every resolver below must land inside the override.
"""
from __future__ import annotations
import pytest
from hermes_constants import reset_hermes_home_override, set_hermes_home_override
def _a2a_conversation(home):
from plugins.platforms.a2a import protocol
return protocol._conv_path("peer-x")
def _photon_auth(home):
from plugins.platforms.photon import auth
return auth._auth_json_path()
def _openviking_log(home):
import plugins.memory.openviking as ov
return ov.get_hermes_home() / ov._OPENVIKING_SERVER_LOG_RELATIVE_PATH
_RESOLVERS = {"a2a": _a2a_conversation, "photon": _photon_auth,
"openviking": _openviking_log}
@pytest.mark.parametrize("name", sorted(_RESOLVERS))
def test_plugin_path_follows_profile_override(name, tmp_path, monkeypatch):
monkeypatch.setenv("HERMES_HOME", str(tmp_path / "default"))
monkeypatch.setenv("HOME", str(tmp_path / "user-home"))
profile = tmp_path / "profiles" / "b"
profile.mkdir(parents=True)
token = set_hermes_home_override(profile)
try:
resolved = str(_RESOLVERS[name](profile))
finally:
reset_hermes_home_override(token)
assert resolved.startswith(str(profile)), f"{name} resolved {resolved!r} outside the active profile"