Skip to content

The agent that grows with you

test(plugins): cover a server declaration with only unknown keys

Teknium8f770d179dce
diff --git a/tests/hermes_cli/test_agent_plugins.py b/tests/hermes_cli/test_agent_plugins.py
index 694df8bd10f..4c038a2fb45 100644
--- a/tests/hermes_cli/test_agent_plugins.py
+++ b/tests/hermes_cli/test_agent_plugins.py
@@ -211,14 +211,16 @@ def test_unknown_fields_and_non_object_extensions_are_nonfatal(tmp_path: Path) -
assert len(package.diagnostics) == 2
-def test_unknown_server_declaration_key_is_ignored_and_known_keys_still_apply(tmp_path: Path) -> None:
[email protected]("declared", [{"trust": "untrusted", "future_key": 5}, {"future_key": 5}])
+def test_unknown_server_declaration_key_is_ignored_and_known_keys_still_apply(tmp_path: Path, declared: dict) -> None:
# A key a newer Hermes added must not make the package uninstallable on this one (REA's
# `timeout` broke every v0.22.2 install); the keys this release knows, trust included, still hold.
_remote_package(tmp_path)
_write_json(tmp_path / "plugin.json", _manifest(extensions={
- "com.nousresearch.hermes": {"servers": {"trade": {"trust": "untrusted", "future_key": 5}}}}))
+ "com.nousresearch.hermes": {"servers": {"trade": declared}}}))
package = load_agent_plugin(tmp_path, tmp_path / "data")
- assert package.mcp_servers["trade"]["trust"] == "untrusted"
+ assert package.mcp_servers["trade"].get("trust") == declared.get("trust")
+ assert "trade" not in package.server_declarations
assert [d.scope for d in package.diagnostics] == ["server:trade"]
assert "future_key" in package.diagnostics[0].message