hermes_cli.__version__ is the frozen old-updater compat surface and reads only the install stamp, so a git checkout handshook as "hermes-agent/0.0.0". Use get_version_info().base_version like the MCP OAuth User-Agent does. mcp.types.Implementation exists on every SDK we pin (mcp==2.3.0), so the ImportError fallback and the test pinning it are gone; the existing _client_session_accepts gate still covers SDKs without the kwarg. The test moves to tests/tools/test_mcp_tool_client_info.py: test_mcp_tool.py is over its line cap and may only shrink.
15 lines
559 B
Python
15 lines
559 B
Python
"""The MCP handshake names hermes-agent and its release, not the SDK default ("mcp"/"0.1.0")."""
|
|
|
|
import pytest
|
|
|
|
|
|
def test_session_kwargs_carry_hermes_client_identity():
|
|
from tools.mcp_tool import MCPServerTask, _ensure_mcp_sdk
|
|
if not _ensure_mcp_sdk():
|
|
pytest.skip("mcp SDK not installed")
|
|
from hermes_cli.version_info import get_version_info
|
|
|
|
kwargs = MCPServerTask("identity_test")._session_kwargs()
|
|
assert kwargs["client_info"].name == "hermes-agent"
|
|
assert kwargs["client_info"].version == get_version_info().base_version
|