The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(plugins): a newer server-declaration key no longer makes a plugin uninstallable
Teknium0706401b80f0
diff --git a/hermes_cli/agent_plugins.py b/hermes_cli/agent_plugins.pyindex 6cdc3a372bd..73192ca32bc 100644--- a/hermes_cli/agent_plugins.py+++ b/hermes_cli/agent_plugins.py@@ -90,8 +90,12 @@ class AgentPluginPackage:diagnostics: tuple[AgentPluginDiagnostic, ...]+_SERVER_DECLARATION_KEYS = frozenset({"app", "requires", "liveness", "trust", "timeout"})++def _server_declarations(- manifest: Mapping[str, Any], mcp_servers: Mapping[str, dict[str, Any]]+ manifest: Mapping[str, Any], mcp_servers: Mapping[str, dict[str, Any]],+ diagnostics: list[AgentPluginDiagnostic] | None = None,) -> dict[str, AgentPluginServerDeclaration]:namespace = manifest.get("extensions", {}).get(_HERMES_EXTENSION, {})raw_servers = namespace.get("servers", {})@@ -103,11 +107,19 @@ def _server_declarations(raise AgentPluginError(f"server declaration '{name}' has no matching mcp.json server")if not isinstance(raw, dict):raise AgentPluginError(f"server declaration '{name}' must be an object")+ # A key added by a newer Hermes must not make the package uninstallable here: the older+ # release ignores it with a diagnostic, like unknown top-level fields. A key whose absence+ # would be unsafe needs the catalog's requires_hermes, not a hard failure on every release.+ unknown = set(raw) - _SERVER_DECLARATION_KEYS+ if unknown:+ if diagnostics is not None:+ diagnostics.append(AgentPluginDiagnostic(+ f"server:{name}", f"ignored unknown keys {sorted(unknown)} (needs a newer Hermes)"))+ raw = {key: value for key, value in raw.items() if key not in unknown}+ if not raw:+ continueif "liveness" in raw and "app" not in raw and "requires" not in raw:raise AgentPluginError(f"server declaration '{name}' has liveness without app or requires")- unknown = set(raw) - {"app", "requires", "liveness", "trust", "timeout"}- if unknown:- raise AgentPluginError(f"server declaration '{name}' has unknown keys {sorted(unknown)}")if raw and set(raw) <= {"trust", "timeout"}:continue # transport settings alone do not declare an applicationtry:@@ -468,11 +480,12 @@ def load_agent_plugin(plugin_root: Path, data_root: Path) -> AgentPluginPackage:mcp_servers[name] = {**mcp_servers[name], "trust": tier}for name, timeout in _server_timeouts(manifest, mcp_servers).items():mcp_servers[name] = {**mcp_servers[name], "timeout": timeout}+ server_declarations = _server_declarations(manifest, mcp_servers, diagnostics)return AgentPluginPackage(name=manifest["name"], version=manifest.get("version", ""),description=manifest.get("description", ""), root=root, data_root=resolved_data,manifest=dict(manifest), skills=skills, mcp_servers=mcp_servers,- server_declarations=_server_declarations(manifest, mcp_servers),+ server_declarations=server_declarations,diagnostics=tuple(diagnostics),)diff --git a/tests/hermes_cli/test_agent_plugins.py b/tests/hermes_cli/test_agent_plugins.pyindex 3e4d92d79fb..694df8bd10f 100644--- a/tests/hermes_cli/test_agent_plugins.py+++ b/tests/hermes_cli/test_agent_plugins.py@@ -211,6 +211,18 @@ 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:+ # 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}}}}))+ package = load_agent_plugin(tmp_path, tmp_path / "data")+ assert package.mcp_servers["trade"]["trust"] == "untrusted"+ assert [d.scope for d in package.diagnostics] == ["server:trade"]+ assert "future_key" in package.diagnostics[0].message++def test_invalid_skill_does_not_hide_valid_sibling(tmp_path: Path) -> None:_write_json(tmp_path / "plugin.json", _manifest())_write_skill(tmp_path, "valid-skill", license="MIT", compatibility="Linux")diff --git a/website/docs/developer-guide/plugins/index.md b/website/docs/developer-guide/plugins/index.mdindex 5ac5838684a..9cfb32e985d 100644--- a/website/docs/developer-guide/plugins/index.md+++ b/website/docs/developer-guide/plugins/index.md@@ -162,6 +162,12 @@ extends the wait budget, not the cancellation or permission policy. Configureany server-internal analysis deadline separately and leave time for its resultto reach the client. Other harnesses ignore this extension.+A server entry key this Hermes does not know (one a newer release added) is+ignored with a warning, which `hermes plugins validate` lists, and the package+still installs. Releases from before this rule reject the package instead, and a+release that ignores a key may behave less safely than intended, so declare a new+key together with a catalog `requires_hermes` floor.+An explicit per-server MCP call budget also reaches Hermes' outer tool executor. A callwhose budget exceeds the shared concurrent-batch deadline becomes a sequentialbarrier, whether called directly or through tool search. It gets its own budget