From 7cd71de1f45b060b1404b2f0c5bf4cb4305dd716 Mon Sep 17 00:00:00 2001 From: Shannon Sands Date: Tue, 16 Jun 2026 12:57:28 +1000 Subject: [PATCH] Simplify dashboard update detection to containers --- hermes_cli/web_server.py | 18 +++++++----------- .../test_dashboard_admin_endpoints.py | 4 ++-- tests/hermes_cli/test_web_server.py | 9 ++++----- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/hermes_cli/web_server.py b/hermes_cli/web_server.py index 007e598102e..7cd3a7eaa03 100644 --- a/hermes_cli/web_server.py +++ b/hermes_cli/web_server.py @@ -1227,15 +1227,11 @@ def _default_hermes_root_is_opt_data() -> bool: def _dashboard_local_update_managed_externally() -> bool: """Return true when the dashboard should not offer ``hermes update``. - Hosted agent dashboards run with the Hermes root at ``/opt/data``. Generic - containerized dashboards may not use that exact root, but their lifecycle is - still owned by the outer launcher/image, not by an in-browser local update - action. Keep this dashboard capability separate from install-method - detection: manual git/pip installs inside containers can still behave like - their actual install method in the CLI. + Containerized dashboards are updated by the outer launcher/image, not by an + in-browser local update action. Keep this dashboard capability separate + from install-method detection: manual git/pip installs inside containers can + still behave like their actual install method in the CLI. """ - if _default_hermes_root_is_opt_data(): - return True try: from hermes_constants import is_container @@ -2188,7 +2184,7 @@ async def update_hermes(): """Kick off ``hermes update`` in the background.""" if _dashboard_local_update_managed_externally(): message = ( - "Hermes updates are managed outside this dashboard for hosted or " + "Hermes updates are managed outside this dashboard in " "containerized environments. The built-in local updater is " "disabled here." ) @@ -2310,8 +2306,8 @@ async def check_hermes_update(force: bool = False): "can_apply": False, "update_command": "managed outside dashboard", "message": ( - "Hermes updates are managed outside this dashboard for hosted " - "or containerized environments." + "Hermes updates are managed outside this dashboard in " + "containerized environments." ), } diff --git a/tests/hermes_cli/test_dashboard_admin_endpoints.py b/tests/hermes_cli/test_dashboard_admin_endpoints.py index b87489e7f39..3eb2ca37d2d 100644 --- a/tests/hermes_cli/test_dashboard_admin_endpoints.py +++ b/tests/hermes_cli/test_dashboard_admin_endpoints.py @@ -772,7 +772,7 @@ class TestUpdateCheckEndpoint: assert body["message"] assert body["behind"] is None - def test_hosted_dashboard_is_not_applyable(self, monkeypatch): + def test_managed_runtime_dashboard_is_not_applyable(self, monkeypatch): import hermes_cli.web_server as ws monkeypatch.setattr(ws, "_dashboard_local_update_managed_externally", lambda: True) @@ -780,7 +780,7 @@ class TestUpdateCheckEndpoint: ws, "detect_install_method", lambda *a, **k: pytest.fail( - "hosted update check should not probe install method" + "managed runtime update check should not probe install method" ), ) diff --git a/tests/hermes_cli/test_web_server.py b/tests/hermes_cli/test_web_server.py index 2bc3138d4f8..8f6842b6b50 100644 --- a/tests/hermes_cli/test_web_server.py +++ b/tests/hermes_cli/test_web_server.py @@ -247,7 +247,7 @@ class TestWebServerEndpoints: assert "active_sessions" in data assert data["can_update_hermes"] is True - def test_get_status_hides_update_capability_in_hosted_mode(self, monkeypatch): + def test_get_status_hides_update_capability_in_managed_runtime(self, monkeypatch): import hermes_cli.web_server as web_server monkeypatch.setattr(web_server, "_dashboard_local_update_managed_externally", lambda: True) @@ -260,7 +260,6 @@ class TestWebServerEndpoints: import hermes_constants import hermes_cli.web_server as web_server - monkeypatch.setattr(web_server, "_default_hermes_root_is_opt_data", lambda: False) monkeypatch.setattr(hermes_constants, "is_container", lambda: True) assert web_server._dashboard_local_update_managed_externally() is True @@ -931,7 +930,7 @@ class TestWebServerEndpoints: assert status_data["pid"] is None assert any("docker pull nousresearch/hermes-agent:latest" in line for line in status_data["lines"]) - def test_update_hermes_returns_hosted_guidance_without_spawning(self, monkeypatch): + def test_update_hermes_returns_managed_runtime_guidance_without_spawning(self, monkeypatch): import hermes_cli.web_server as web_server spawned = False @@ -940,12 +939,12 @@ class TestWebServerEndpoints: def fail_spawn(*_args, **_kwargs): nonlocal spawned spawned = True - raise AssertionError("hosted update guard should not spawn hermes update") + raise AssertionError("managed runtime update guard should not spawn hermes update") def fail_detect(*_args, **_kwargs): nonlocal detected detected = True - raise AssertionError("hosted update guard should not detect install method") + raise AssertionError("managed runtime update guard should not detect install method") monkeypatch.setattr(web_server, "_dashboard_local_update_managed_externally", lambda: True) monkeypatch.setattr(web_server, "detect_install_method", fail_detect)