The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix: treat core memory-provider sentinels as built-in, not plugins
teknium1a947002e7bbd
diff --git a/agent/agent_init.py b/agent/agent_init.pyindex 902a6a6f00d..4be3e3852a9 100644--- a/agent/agent_init.py+++ b/agent/agent_init.py@@ -26,6 +26,7 @@ from agent.context_compressor import ContextCompressorfrom agent.agent_runtime_helpers import _rafrom agent.iteration_budget import IterationBudget, normalize_budget_warning_ratiofrom agent.memory_manager import StreamingContextScrubber+from agent.memory_provider import is_core_memory_providerfrom agent.session_activity import ActivityProvenancefrom agent.model_metadata import (MINIMUM_CONTEXT_LENGTH, fetch_model_metadata, is_local_endpoint, query_ollama_num_ctx@@ -1295,7 +1296,7 @@ def _init_memory(agent, _agent_cfg, skip_memory, platform):if not skip_memory:try:_mem_provider_name = mem_config.get("provider", "") if mem_config else ""- if _mem_provider_name and _mem_provider_name.strip():+ if not is_core_memory_provider(_mem_provider_name):from agent.memory_manager import MemoryManager as _MemoryManagerfrom plugins.memory import load_memory_provider as _load_memagent._memory_manager = _MemoryManager()diff --git a/agent/memory_provider.py b/agent/memory_provider.pyindex 938fd0b003c..f9f4bcd4f68 100644--- a/agent/memory_provider.py+++ b/agent/memory_provider.py@@ -39,6 +39,15 @@ PRE_COMPRESS_CHECKPOINT_API_VERSION = 2# Default glyph for recall indicators; providers may use their own brand mark.INDICATOR_GLYPH = "🧠"+# ``memory.provider`` values that mean "the built-in store, no external plugin". The built-in+# store is core: doctor, migration and dependency refresh must never look these up as plugins.+CORE_MEMORY_PROVIDER_SENTINELS = frozenset({"", "default", "builtin", "built-in", "none"})+++def is_core_memory_provider(name: Optional[str]) -> bool:+ """True when ``memory.provider`` selects the built-in store rather than an external plugin."""+ return str(name or "").strip().lower() in CORE_MEMORY_PROVIDER_SENTINELS+@dataclass(frozen=True)class RecallStatus:diff --git a/hermes_cli/doctor_state.py b/hermes_cli/doctor_state.pyindex 60972cdf4e3..f287511e655 100644--- a/hermes_cli/doctor_state.py+++ b/hermes_cli/doctor_state.py@@ -531,8 +531,9 @@ def _memory_provider_generic(name: str) -> None:@doctor_check()def _check_memory_provider(should_fix: bool, f: Finding) -> None:from hermes_cli.doctor import HERMES_HOME+ from agent.memory_provider import is_core_memory_providername = _doctor_memory_config(HERMES_HOME).get("provider", "")- if not name:+ if is_core_memory_provider(name):check_ok("Built-in memory active", "(no external provider configured — this is fine)")returnchecker, missing_row, missing_issue, label = _MEMORY_PROVIDER_CHECKS.get(name, (None, None, None, name))diff --git a/hermes_cli/memory_provider_migration.py b/hermes_cli/memory_provider_migration.pyindex 8e6205e7c5b..2fec8417f3b 100644--- a/hermes_cli/memory_provider_migration.py+++ b/hermes_cli/memory_provider_migration.py@@ -60,7 +60,8 @@ def migrate_home(home: Path, *, install: Callable[[str], dict], say: Callable[[supdate or the agent down with it."""name = configured_provider(home)- if not name or provider_present(name, home):+ from agent.memory_provider import is_core_memory_provider+ if is_core_memory_provider(name) or provider_present(name, home):return Noneif catalog_source(name) is None:say(f" ⚠ Memory provider '{name}' is configured but not installed and not in the plugin catalog. "diff --git a/hermes_cli/update_cmd_deps.py b/hermes_cli/update_cmd_deps.pyindex aa366f0782c..6cee9656c06 100644--- a/hermes_cli/update_cmd_deps.py+++ b/hermes_cli/update_cmd_deps.py@@ -386,8 +386,9 @@ def _refresh_active_memory_provider_dependencies() -> None:returnprovider = str(memory_cfg.get("provider") or "").strip()- # "default"/empty is the built-in file store — no pip deps.- if not provider or provider in {"default", "builtin", "none"}:+ # The built-in file store has no pip deps.+ from agent.memory_provider import is_core_memory_provider+ if is_core_memory_provider(provider):returntry:diff --git a/hermes_cli/web_server_memory.py b/hermes_cli/web_server_memory.pyindex 379dd81dd41..6902a93579c 100644--- a/hermes_cli/web_server_memory.py+++ b/hermes_cli/web_server_memory.py@@ -24,8 +24,9 @@ _MEMORY_PROVIDER_IMPORT_NAMES = {def _normalize_memory_provider_name(name: Any) -> str:+ from agent.memory_provider import is_core_memory_providerprovider = str(name or "").strip()- return "" if provider.lower() in {"built-in", "builtin", "none"} else provider+ return "" if is_core_memory_provider(provider) else providerdef _load_memory_provider(name: str):diff --git a/tests/hermes_cli/test_memory_provider_core_sentinels.py b/tests/hermes_cli/test_memory_provider_core_sentinels.pynew file mode 100644index 00000000000..dc78af8b97f--- /dev/null+++ b/tests/hermes_cli/test_memory_provider_core_sentinels.py@@ -0,0 +1,32 @@+"""``memory.provider`` set to a core sentinel (``builtin``/``default``/``none``) names the built-in+store, not a plugin: doctor and the provider migration must not report it as missing (#75647, #115113)."""++from pathlib import Path++import pytest++from hermes_cli import doctor, doctor_state+from hermes_cli import memory_provider_migration as mig++[email protected]("sentinel", ["builtin", "Default", "none"])+def test_doctor_treats_core_sentinel_as_builtin_memory(tmp_path: Path, monkeypatch, capsys, sentinel):+ (tmp_path / "config.yaml").write_text(f"memory:\n provider: {sentinel}\n")+ monkeypatch.setattr(doctor, "HERMES_HOME", tmp_path)++ finding = doctor_state._check_memory_provider(False)+ out = capsys.readouterr().out++ assert "Built-in memory active" in out+ assert "plugin not found" not in out+ assert finding.issues == []+++def test_migration_never_installs_a_core_sentinel(tmp_path: Path, monkeypatch):+ monkeypatch.setenv("HERMES_HOME", str(tmp_path))+ (tmp_path / "config.yaml").write_text("memory:\n provider: builtin\n")+ monkeypatch.setattr(mig, "catalog_source", lambda name: pytest.fail("catalog must not be consulted"))+ said: list[str] = []++ assert mig.migrate_home(tmp_path, install=lambda n: pytest.fail("must not install"), say=said.append) is None+ assert said == []