Skip to content

The agent that grows with you

test(config): cover plugin MCP servers' mcp-<server> names; name the canonical form in the docstring

kshitijk4poorc73152281421
diff --git a/hermes_cli/toolset_validation.py b/hermes_cli/toolset_validation.py
index 264ad1bae8d..ad7f60e28aa 100644
--- a/hermes_cli/toolset_validation.py
+++ b/hermes_cli/toolset_validation.py
@@ -53,8 +53,8 @@ def _platform_default_is_valid(
def saved_toolset_resolver(config: dict) -> Callable[[str], bool]:
"""``is_valid_toolset`` for a saved ``platform_toolsets`` list, mirroring what
``tools_config._get_platform_tools`` lets through: registered toolsets, any configured MCP server by
- its bare or ``mcp-<server>`` toolset name (a disabled one is inactive, not a typo; the prefixed
- alias is registered only after MCP discovery), ``hermes-<platform>`` plugin-platform bundles and the
+ its ``mcp-<server>`` toolset name or bare alias (neither is registered before MCP discovery; a
+ disabled server is inactive, not a typo), ``hermes-<platform>`` plugin-platform bundles and the
``no_mcp`` sentinel. The manifest scan and the plugin lookup (which may run plugin discovery)
happen only for a name the cheaper checks cannot place."""
from functools import cache
diff --git a/tests/hermes_cli/test_config_check_diagnostics.py b/tests/hermes_cli/test_config_check_diagnostics.py
index 423f798a563..3e604c5efb5 100644
--- a/tests/hermes_cli/test_config_check_diagnostics.py
+++ b/tests/hermes_cli/test_config_check_diagnostics.py
@@ -22,13 +22,13 @@ def _check(home: Path, monkeypatch, capsys) -> str:
def test_config_check_and_migrate_agree_on_stale_platform_toolsets(tmp_path, monkeypatch, capsys):
- # No plugin provides 'ghost'; keep host-installed plugins out of the verdict.
+ # Only a plugin MCP server named 'portable' exists; keep host-installed plugins out of the verdict.
monkeypatch.setattr(plugins_mod, "get_plugin_toolset_keys_nowait", set)
- monkeypatch.setattr(plugins_mod, "get_portable_mcp_server_names_nowait", set)
+ monkeypatch.setattr(plugins_mod, "get_portable_mcp_server_names_nowait", lambda: {"portable"})
stale = _write_home(
tmp_path / "stale",
"platform_toolsets:\n"
- " cli: [hermes-cli, messaging, linear, mcp-linear, mcp-ghost, ghost]\n"
+ " cli: [hermes-cli, messaging, linear, mcp-linear, mcp-portable, mcp-ghost, ghost]\n"
" teams: [hermes-teams]\n"
"mcp_servers:\n"
" linear:\n"
@@ -43,7 +43,7 @@ def test_config_check_and_migrate_agree_on_stale_platform_toolsets(tmp_path, mon
for home, expected in ((stale, {"messaging", "ghost", "mcp-ghost"}), (clean, set()), (stale, {"messaging", "ghost", "mcp-ghost"})):
output = _check(home, monkeypatch, capsys)
- for name in ("messaging", "ghost", "mcp-ghost", "linear", "mcp-linear", "hermes-teams"):
+ for name in ("messaging", "ghost", "mcp-ghost", "linear", "mcp-linear", "mcp-portable", "hermes-teams"):
assert (f"unknown toolset '{name}'" in output) is (name in expected), (home.name, name)
results = {"warnings": []}