diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 9175c41e2..0a7657f33 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -467,6 +467,7 @@ async def get_status(): "latest_config_version": latest_ver, "gateway_running": gateway_running, "gateway_pid": gateway_pid, + "gateway_health_url": _GATEWAY_HEALTH_URL, "gateway_state": gateway_state, "gateway_platforms": gateway_platforms, "gateway_exit_reason": gateway_exit_reason, diff --git a/tests/hermes_cli/test_web_server.py b/tests/hermes_cli/test_web_server.py index 365e3d0fe..e99e49d80 100644 --- a/tests/hermes_cli/test_web_server.py +++ b/tests/hermes_cli/test_web_server.py @@ -1122,6 +1122,7 @@ class TestStatusRemoteGateway: assert data["gateway_running"] is True assert data["gateway_pid"] == 999 assert data["gateway_state"] == "running" + assert data["gateway_health_url"] == "http://gw:8642" def test_status_remote_probe_not_attempted_when_local_pid_found(self, monkeypatch): """When local PID check succeeds, the remote probe is never called.""" @@ -1158,6 +1159,7 @@ class TestStatusRemoteGateway: assert resp.status_code == 200 data = resp.json() assert data["gateway_running"] is False + assert data["gateway_health_url"] is None def test_status_remote_running_null_pid(self, monkeypatch): """Remote gateway running but PID not in response — pid should be None.""" diff --git a/web/src/lib/api.ts b/web/src/lib/api.ts index 5b959bc59..c8bee0408 100644 --- a/web/src/lib/api.ts +++ b/web/src/lib/api.ts @@ -213,6 +213,7 @@ export interface StatusResponse { config_version: number; env_path: string; gateway_exit_reason: string | null; + gateway_health_url: string | null; gateway_pid: number | null; gateway_platforms: Record; gateway_running: boolean; diff --git a/web/src/pages/StatusPage.tsx b/web/src/pages/StatusPage.tsx index 0b71d2c96..c13645b05 100644 --- a/web/src/pages/StatusPage.tsx +++ b/web/src/pages/StatusPage.tsx @@ -53,6 +53,7 @@ export default function StatusPage() { }; function gatewayValue(): string { + if (status!.gateway_running && status!.gateway_health_url) return status!.gateway_health_url; if (status!.gateway_running && status!.gateway_pid) return `${t.status.pid} ${status!.gateway_pid}`; if (status!.gateway_running) return t.status.runningRemote; if (status!.gateway_state === "startup_failed") return t.status.startFailed; @@ -137,14 +138,14 @@ export default function StatusPage() {
{items.map(({ icon: Icon, label, value, badgeText, badgeVariant }) => ( - + {label} -
{value}
+
{value}
{badgeText && (