Files
hermes-agent/tests/hermes_cli/test_memory_status_env_hint.py
T
Ben 34c727c5c2 feat(hindsight): memory provider improvements — recall_sync, retain_source, setup templates, memory indicators, error hints
Bundles previously-separate Hindsight/memory PRs into a single review surface:
- opt-in synchronous recall (recall_sync) — recall the injected memory in-turn instead of next-turn prefetch (#5820)
- actionable error when local_embedded runtime is missing — tells the user which package to install (#7718)
- default retain_source to 'hermes' so every stored memory self-identifies its provenance
- offer a starter memory template during hermes memory setup, plus warn before overwriting an already-configured bank
- warn when a configured memory provider reports unavailable (#2765)
- deterministic 'recalled N memories' recall indicator — Hermes itself emits a status line when auto-recall injects memory
- 'saving to memory' retain indicator — emitted the moment a turn is dispatched to the writer

Authored by @benfrank241 (ben.bartholomew@vectorize.io).
Salvaged from PR #74379.
2026-08-13 23:15:25 +05:30

44 lines
1.4 KiB
Python

"""`hermes memory status` should explain *why* a provider is unavailable.
Regression coverage for NousResearch/hermes-agent#2765: when the selected
provider reports unavailable, status lists the missing env vars and surfaces
the systemd/gateway ``.env``-inheritance gotcha that most often causes it.
"""
import hermes_cli.memory_setup as memory_setup
class _UnavailableProvider:
def is_available(self):
return False
def get_config_schema(self):
return [
{
"key": "api_key",
"env_var": "HINDSIGHT_API_KEY",
"secret": True,
"url": "https://ui.hindsight.vectorize.io",
}
]
def test_status_surfaces_env_inheritance_hint_when_unavailable(monkeypatch, capsys):
monkeypatch.delenv("HINDSIGHT_API_KEY", raising=False)
monkeypatch.setattr(
memory_setup,
"_get_available_providers",
lambda: [("hindsight", "cloud", _UnavailableProvider())],
)
monkeypatch.setattr(
"hermes_cli.config.load_config",
lambda: {"memory": {"provider": "hindsight", "hindsight": {}}},
)
memory_setup.cmd_status(object())
out = capsys.readouterr().out
assert "not available" in out
assert "HINDSIGHT_API_KEY" in out # names the missing var
assert ".env" in out # systemd/gateway root-cause hint