fix(api_server): report hermes version on /health and /health/detailed (#40620)

Salvaged from #40479; re-verified on main, tightened, tested.

Co-authored-by: tfournet <tfournet@users.noreply.github.com>
This commit is contained in:
Teknium
2026-06-07 18:38:54 -07:00
committed by GitHub
co-authored by tfournet
parent d3b670e63e
commit 30c7913617
2 changed files with 42 additions and 1 deletions
+15
View File
@@ -497,6 +497,20 @@ class TestHealthEndpoint:
assert data["status"] == "ok"
assert data["platform"] == "hermes-agent"
@pytest.mark.asyncio
async def test_health_reports_version(self, adapter):
"""GET /health must expose a non-empty version so orchestrators (e.g.
AgentOS) can read the gateway version without scraping. Regression
guard for the missing-version gap."""
app = _create_app(adapter)
async with TestClient(TestServer(app)) as cli:
resp = await cli.get("/health")
assert resp.status == 200
data = await resp.json()
assert "version" in data
assert isinstance(data["version"], str)
assert data["version"] != ""
@pytest.mark.asyncio
async def test_v1_health_alias_returns_ok(self, adapter):
"""GET /v1/health should return the same response as /health."""
@@ -507,6 +521,7 @@ class TestHealthEndpoint:
data = await resp.json()
assert data["status"] == "ok"
assert data["platform"] == "hermes-agent"
assert data.get("version")
# ---------------------------------------------------------------------------