test: cover config-aware memory status labels + AUTHOR_MAP entry

Add tests/hermes_cli/test_memory_status.py with 11 tests covering:
- No hardcoded 'always active' label
- memory_enabled, user_profile_enabled, memory toolset indicators
- Tool enabled/disabled via platform_toolsets.cli
- Provider still shown alongside indicators

Add huajiang@tubi.tv → thirstycrow to AUTHOR_MAP (PR #23630 salvage).
This commit is contained in:
kshitij
2026-07-23 17:09:59 +05:00
committed by kshitij
parent 4c99a44e6d
commit c82c5786f4
2 changed files with 106 additions and 0 deletions

View File

@@ -919,6 +919,7 @@ LEGACY_AUTHOR_MAP = {
"thomasjhon6666@gmail.com": "ThomassJonax",
"focusflow.app.help@gmail.com": "yes999zc",
"rob@atlas.lan": "rmoen",
"huajiang@tubi.tv": "thirstycrow", # PR #23630 salvage (config-aware memory status labels)
# Slack ephemeral slash-ack salvage (May 2026)
"probepark@users.noreply.github.com": "probepark",
# Slack batch salvage (May 2026)

View File

@@ -0,0 +1,105 @@
"""Tests for `hermes memory status` CLI command.
Covers:
- Status output shows config-aware indicators instead of hardcoded 'always active'
- memory_enabled, user_profile_enabled, and memory toolset are each reflected
- Original issue: 'Built-in: always active' was misleading when features were disabled
"""
import pytest
from unittest.mock import patch
def _run_cmd_status(capfd, mem_config=None, platform_toolsets=None):
"""Run cmd_status with a mocked config and return captured stdout."""
from hermes_cli.memory_setup import cmd_status
config = {"memory": mem_config or {}}
if platform_toolsets is not None:
config["platform_toolsets"] = platform_toolsets
with patch("hermes_cli.config.load_config", return_value=config):
with patch("hermes_cli.memory_setup._get_available_providers", return_value=[]):
cmd_status(args=None)
captured = capfd.readouterr()
return captured.out
class TestMemoryStatusLabels:
"""Status output should reflect actual config, not a hardcoded string."""
def test_no_hardcoded_always_active(self, capfd):
"""The old 'always active' label must not appear."""
out = _run_cmd_status(capfd)
assert "always active" not in out
def test_shows_memory_injection_enabled_by_default(self, capfd):
"""Memory injection defaults to enabled."""
out = _run_cmd_status(capfd)
assert "Memory injection:" in out
assert "enabled ✓" in out
def test_shows_memory_injection_disabled(self, capfd):
"""When memory_enabled is false, status reflects it."""
out = _run_cmd_status(capfd, mem_config={"memory_enabled": False})
assert "Memory injection:" in out
assert "disabled ✗" in out
def test_shows_user_profile_disabled(self, capfd):
"""When user_profile_enabled is false, status reflects it."""
out = _run_cmd_status(
capfd, mem_config={"user_profile_enabled": False}
)
assert "User profile:" in out
assert "disabled ✗" in out
def test_shows_user_profile_enabled(self, capfd):
"""When user_profile_enabled is true, status reflects it."""
out = _run_cmd_status(
capfd, mem_config={"user_profile_enabled": True}
)
assert "User profile:" in out
assert "enabled ✓" in out
def test_memory_tool_enabled_by_default(self, capfd):
"""Memory tool is enabled by default (no platform_toolsets = all enabled)."""
out = _run_cmd_status(capfd)
assert "Memory tool:" in out
assert "enabled ✓" in out
def test_memory_tool_disabled_via_toolset(self, capfd):
"""When CLI toolset excludes 'memory', the tool shows disabled."""
out = _run_cmd_status(
capfd,
platform_toolsets={"cli": ["terminal", "file"]},
)
assert "Memory tool:" in out
assert "disabled ✗" in out
def test_memory_tool_enabled_via_toolset(self, capfd):
"""When CLI toolset includes 'memory', the tool shows enabled."""
out = _run_cmd_status(
capfd,
platform_toolsets={"cli": ["terminal", "file", "memory"]},
)
assert "Memory tool:" in out
assert "enabled ✓" in out
def test_provider_still_shown(self, capfd):
"""Provider line still appears alongside the config indicators."""
out = _run_cmd_status(
capfd, mem_config={"provider": "honcho", "memory_enabled": True}
)
assert "honcho" in out
assert "Memory injection:" in out
def test_all_disabled(self, capfd):
"""All three indicators show disabled when everything is off."""
out = _run_cmd_status(
capfd,
mem_config={"memory_enabled": False, "user_profile_enabled": False},
platform_toolsets={"cli": ["terminal"]},
)
assert out.count("disabled ✗") == 3
assert "always active" not in out