The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(update): warn surviving pre-update serve and dashboard runtimes on success (#100479)
TwotNguyenVN5733d55f7794
diff --git a/hermes_cli/update_cmd.py b/hermes_cli/update_cmd.pyindex 0452f63a8b7..e23b07a16ed 100644--- a/hermes_cli/update_cmd.py+++ b/hermes_cli/update_cmd.py@@ -10814,6 +10814,15 @@ def _cmd_update_impl(args, gateway_mode: bool):node_failures, already_restarted_units=set(restarted_services))+ # Check if any pre-update serve/dashboard runtimes survived on+ # pre-update code generations (#100479).+ try:+ _stale_serve_rows = _surviving_pre_update_serve_runtimes(_pre_update_plan)+ if _stale_serve_rows:+ _warn_stale_serve_runtimes(_stale_serve_rows)+ except Exception as _serve_warn_exc:+ logger.debug("Failed to check for surviving serve runtimes: %s", _serve_warn_exc)+print()print("Tip: You can now select a provider and model:")print(" hermes model # Select provider and model")diff --git a/tests/hermes_cli/test_update_fleet_restart_pending.py b/tests/hermes_cli/test_update_fleet_restart_pending.pyindex f8390047a25..9e5a52f208a 100644--- a/tests/hermes_cli/test_update_fleet_restart_pending.py+++ b/tests/hermes_cli/test_update_fleet_restart_pending.py@@ -102,16 +102,21 @@ def _patch_update_deps(monkeypatch, tmp_path, run_side_effect):monkeypatch.setattr(hermes_main, "_finish_dashboard_update_cleanup", lambda *a, **k: None)+ monkeypatch.setattr(+ update_cmd, "_finish_dashboard_update_cleanup", lambda *a, **k: None+ )monkeypatch.setattr(hermes_main, "_build_web_ui", lambda *a, **k: None)monkeypatch.setattr(update_cmd, "_venv_core_imports_healthy", lambda: (True, ""))monkeypatch.setattr(update_cmd, "_update_node_dependencies", lambda: [])+ monkeypatch.setattr(update_cmd, "_purge_stale_hermes_modules", lambda: None)+ monkeypatch.setattr(hermes_main, "_purge_stale_hermes_modules", lambda: None)import hermes_cli.gateway as hermes_gatewaymonkeypatch.setattr(- hermes_gateway, "find_gateway_pids", lambda all_profiles=False: []+ hermes_gateway, "find_gateway_pids", lambda **_kwargs: [])monkeypatch.setattr(hermes_gateway, "supports_systemd_services", lambda: False)monkeypatch.setattr(@@ -302,6 +307,33 @@ def test_marker_written_after_pull_cleared_after_successful_restart(assert "✓ Code updated!" in out+def test_clean_update_warns_about_surviving_pre_update_serve_runtime(+ monkeypatch, tmp_path, capsys+):+ """The successful update path must surface an inventoried stale serve."""+ args = _update_args()+ _patch_update_deps(monkeypatch, tmp_path, _make_head_moved_side_effect())+ monkeypatch.setattr(+ update_cmd,+ "_surviving_pre_update_serve_runtimes",+ lambda _plan: [+ {+ "pid": 5555,+ "kind": "serve",+ "profile": "default",+ "supervisor": "manual-serve",+ }+ ],+ )++ hermes_main.cmd_update(args)++ out = capsys.readouterr().out+ assert "pid 5555" in out+ assert "serve" in out+ assert "pre-update code" in out++def test_interrupt_between_pull_and_restart_leaves_marker(monkeypatch, tmp_path):