The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
refactor(update): collapse 90 try/except-pass and try/except-logger.debug blocks into suppress()/_best_effort() (new leaf update_cmd_common.py)
Tekniumd46eb1f96441
diff --git a/hermes_cli/update_cmd.py b/hermes_cli/update_cmd.pyindex 217f7ee055a..e2ab9ecd8c7 100644--- a/hermes_cli/update_cmd.py+++ b/hermes_cli/update_cmd.py@@ -24,6 +24,7 @@ loaded, so there is no import cycle)."""import logging+from contextlib import suppressimport osimport shleximport shutil # noqa: F401 (tests patch update_cmd.shutil.*; split modules resolve it here)@@ -36,6 +37,7 @@ from pathlib import Path# Both re-exported: the split update_cmd_* modules import them lazily from# here so tests that monkeypatch ``update_cmd.get_hermes_home`` stay effective.from hermes_cli.config import get_hermes_home # noqa: F401+from hermes_cli.update_cmd_common import _best_effortfrom hermes_constants import get_default_hermes_root, venv_python_path# Abort recovery lives in its own bounded module (review on #96235). Re-exported@@ -305,12 +307,10 @@ _UPDATE_CRITICAL_FILES = (def _record_update_step(step: str, ok: bool, detail: str = "") -> None:"""Best-effort ``update_receipt.record_step``; the receipt must never break an update."""- try:+ with suppress(Exception):from hermes_cli.update_receipt import record_steprecord_step(step, ok, detail)- except Exception:- passdef _git_run(git_cmd, args, cwd=None, *, check=False, network=False):@@ -408,13 +408,11 @@ def _gateway_prompt(prompt_text: str, default: str = "", timeout: float = 300.0)deadline = _time.monotonic() + timeoutwhile _time.monotonic() < deadline:if response_path.exists():- try:+ with suppress(OSError, ValueError):answer = response_path.read_text(encoding="utf-8").strip()response_path.unlink(missing_ok=True)prompt_path.unlink(missing_ok=True)return answer if answer else default- except (OSError, ValueError):- pass_time.sleep(0.5)prompt_path.unlink(missing_ok=True)@@ -572,12 +570,10 @@ def _invalidate_update_cache():if entry.is_dir():homes.append(entry)for home in homes:- try:+ with suppress(Exception):cache_file = home / ".update_check"if cache_file.exists():cache_file.unlink()- except Exception:- passdef _write_marker_file(path: Path, *, label: str) -> None:@@ -693,11 +689,9 @@ def _log_only_write(text: str) -> None:log_file = getattr(stream, "_log", None)if log_file is None:return- try:+ with suppress(Exception):log_file.write(text if text.endswith("\n") else text + "\n")log_file.flush()- except Exception:- passdef _run_logged_subprocess(cmd, *, cwd=None, env=None):@@ -1280,7 +1274,7 @@ def _prepare_checkout_for_update(sys.exit(1)if switch_block_reason.startswith("unmerged:"):_in_place_configured = False- try:+ with _best_effort('Could not read updates.parked_branch_strategy: %s'):from hermes_cli.config import load_config as _load_cfg_upd_cfg = (_load_cfg() or {}).get("updates", {})@@ -1289,10 +1283,6 @@ def _prepare_checkout_for_update(and _upd_cfg.get("parked_branch_strategy", "switch")== "update_in_place")- except Exception as exc:- logger.debug(- "Could not read updates.parked_branch_strategy: %s", exc- )if _in_place_configured and not switch_branch:# The merge source must exist upstream; --branch typos# previously surfaced through the checkout failing, which@@ -1503,19 +1493,17 @@ def _begin_update_receipt_and_plan(args):# Phase 1 (#91277): structured update receipt — record what this run# discovers, does, and skips, so silent-failure classes (#88848,# #74973, #85753, #81193) become diagnosable from disk.- try:+ with _best_effort('Update receipt unavailable: %s'):from hermes_cli.update_receipt import begin_update_receiptbegin_update_receipt()- except Exception as _receipt_exc:- logger.debug("Update receipt unavailable: %s", _receipt_exc)# Plan phase (#91277): snapshot every running runtime, supervisor and# code version into the receipt (read-only; probe failure records# nothing). Re-read AFTER the restart phase to reconcile planned# runtimes against bookkeeping — the plan is the worklist._pre_update_plan = None- try:+ with _best_effort('Update plan phase failed: %s'):from hermes_cli.update_inventory import (collect_runtime_inventory,record_plan_in_receipt,@@ -1529,8 +1517,6 @@ def _begin_update_receipt_and_plan(args):sorted({r.profile for r in _pre_update_plan.runtimes}))print(f"→ Fleet: {_n} running service(s) across profiles: {_profiles}")- except Exception as _plan_exc:- logger.debug("Update plan phase failed: %s", _plan_exc)# Windows: abort if another hermes.exe holds the venv shim — continuing# yields WinError 32 spam and a deferred-rename leftover or silent ZIP@@ -1701,12 +1687,10 @@ def _handle_update_called_process_error(' venv\\Scripts\\python.exe -c ''"from hermes_cli.main import main; main()" update --yes')- try:+ with suppress(Exception):from hermes_cli.update_receipt import finalize_update_receiptfinalize_update_receipt("failed")- except Exception:- passsys.exit(1)@@ -1786,15 +1770,10 @@ def _finish_already_up_to_date(if not current_checkout_complete:if gateway_mode:_write_gateway_update_exit_code(False)- try:+ with _best_effort('Update receipt finalize (current checkout) failed: %s'):from hermes_cli.update_receipt import finalize_update_receiptfinalize_update_receipt("partial")- except Exception as _receipt_exc:- logger.debug(- "Update receipt finalize (current checkout) failed: %s",- _receipt_exc,- )sys.exit(1)diff --git a/hermes_cli/update_cmd_common.py b/hermes_cli/update_cmd_common.pynew file mode 100644index 00000000000..1de471b348f--- /dev/null+++ b/hermes_cli/update_cmd_common.py@@ -0,0 +1,20 @@+"""Shared leaf helpers for the ``hermes update`` modules (no Hermes imports; no cycle)."""++import logging+from contextlib import contextmanager++# Log-record parity with the origin module.+logger = logging.getLogger("hermes_cli.update_cmd")+++@contextmanager+def _best_effort(message: str):+ """Run a non-critical update step; swallow ``Exception`` and log it at debug.++ The updater must never die on bookkeeping (receipt, notices, cache seeds):+ ``message`` is the ``%s``-style debug line the inline ``try/except`` used.+ """+ try:+ yield+ except Exception as exc:+ logger.debug(message, exc)diff --git a/hermes_cli/update_cmd_config.py b/hermes_cli/update_cmd_config.pyindex 897464383c7..09e4f1ac5ea 100644--- a/hermes_cli/update_cmd_config.py+++ b/hermes_cli/update_cmd_config.py@@ -8,6 +8,8 @@ import loggingimport sysfrom pathlib import Path+from hermes_cli.update_cmd_common import _best_effort+# Log-record parity with the origin module.logger = logging.getLogger("hermes_cli.update_cmd")@@ -70,7 +72,7 @@ def _migrate_sibling_profile_configs() -> list[tuple[str, int, int]]:"""from hermes_cli.update_cmd import _run_config_check_fresh, _run_migrate_config_freshmigrated: list[tuple[str, int, int]] = []- try:+ with _best_effort('Sibling profile enumeration failed: %s'):from hermes_constants import (get_process_hermes_home,reset_hermes_home_override,@@ -107,8 +109,6 @@ def _migrate_sibling_profile_configs() -> list[tuple[str, int, int]]:)finally:reset_hermes_home_override(token)- except Exception as exc:- logger.debug("Sibling profile enumeration failed: %s", exc)return migrated@@ -248,15 +248,13 @@ def _check_and_apply_config_migration(# The migration above touched only the active profile; run the same NON-INTERACTIVE# migration per sibling home via the context-local HERMES_HOME override (never os.environ).- try:+ with _best_effort('Sibling config migration failed: %s'):_migrated_siblings = _migrate_sibling_profile_configs()for _name, _from_ver, _to_ver in _migrated_siblings:print(f" ✓ Profile '{_name}': config format updated "f"(v{_from_ver} → v{_to_ver})")- except Exception as exc:- logger.debug("Sibling config migration failed: %s", exc)# Safety net: migrations/desktop scheduler have emptied or truncated cron/jobs.json;# restore from the pre-update snapshot if jobs went missing.@@ -295,7 +293,7 @@ def _check_and_apply_config_migration(logger.debug("Config model-settings auto-restore check failed: %s", exc)# Same cron-jobs safety net per sibling profile against ITS OWN pre-update snapshot.- try:+ with _best_effort('Sibling cron auto-restore check failed: %s'):from hermes_cli.backup import restore_cron_jobs_all_profilesfor _restored in restore_cron_jobs_all_profiles(@@ -308,11 +306,9 @@ def _check_and_apply_config_migration(f"{_restored['job_count']} job(s) from pre-update "f"snapshot {_restored['snapshot_id']}.")- except Exception as exc:- logger.debug("Sibling cron auto-restore check failed: %s", exc)# Same config model-settings safety net for sibling profiles.- try:+ with _best_effort('Sibling config auto-restore check failed: %s'):from hermes_cli.backup import restore_config_model_settings_all_profilesfor _cfg_restored in restore_config_model_settings_all_profiles(@@ -325,8 +321,6 @@ def _check_and_apply_config_migration(f"restored {', '.join(_cfg_restored['keys'])} from "f"pre-update snapshot {_cfg_restored['snapshot_id']}.")- except Exception as exc:- logger.debug("Sibling config auto-restore check failed: %s", exc)# {profile: snapshot_id} from this run's pre-update backup, consumed by the per-profilediff --git a/hermes_cli/update_cmd_deps.py b/hermes_cli/update_cmd_deps.pyindex 39faf4f1b68..989e0b5448f 100644--- a/hermes_cli/update_cmd_deps.py+++ b/hermes_cli/update_cmd_deps.py@@ -5,6 +5,7 @@ still resolves/monkeypatches. Origin helpers are imported lazily per function (n"""import logging+from contextlib import suppressimport hashlibimport jsonimport os@@ -114,14 +115,12 @@ def _critical_module_import_failures()try:interpreter = sys.executable- try:+ with suppress(Exception):venv_python = venv_python_path(Path(root) / "venv", windows=_m()._is_windows())if venv_python.exists():interpreter = str(venv_python)- except Exception:- pass # fall back to the running interpreterresult = subprocess.run([interpreter, "-c", probe],cwd=str(root),@@ -529,7 +528,7 @@ def _ensure_uv_for_termux(pip_cmd: list[str]) -> str | None:system_uv = shutil.which("uv")if system_uv:return system_uv- try:+ with suppress(Exception):print(" → Termux detected: trying to install uv for faster dependency updates...")result = subprocess.run(pip_cmd + ["install", "uv", "--only-binary", ":all:"],@@ -538,8 +537,6 @@ def _ensure_uv_for_termux(pip_cmd: list[str]) -> str | None:)if result.returncode != 0:return None- except Exception:- passreturn resolve_uv() or shutil.which("uv")@@ -555,7 +552,7 @@ def _npm_manifest_paths() -> tuple[Path, ...]:from hermes_cli.update_cmd import _mroot_pkg = _m().PROJECT_ROOT / "package.json"paths = [_m().PROJECT_ROOT / "package-lock.json", root_pkg]- try:+ with suppress(OSError, json.JSONDecodeError, TypeError):workspaces = json.loads(root_pkg.read_text(encoding="utf-8")).get("workspaces", [])@@ -566,8 +563,6 @@ def _npm_manifest_paths() -> tuple[Path, ...]:manifest = match / "package.json"if manifest.is_file():paths.append(manifest)- except (OSError, json.JSONDecodeError, TypeError):- passreturn tuple(paths)@@ -712,11 +707,9 @@ def _update_node_dependencies() -> list[str]:# Best-effort npx cache warm before the lockfile-unchanged early return. Can block# ~11s on a cold cache — print first so it doesn't look like a hang.print("→ Warming npx cache for agent-browser...")- try:+ with suppress(Exception):from tools.browser_tool import warm_agent_browser_npx_cachewarm_agent_browser_npx_cache()- except Exception:- passif not _m()._npm_lockfile_changed(shared_hermes_root):logger.info("npm lockfile unchanged, skipping npm install")diff --git a/hermes_cli/update_cmd_fleet.py b/hermes_cli/update_cmd_fleet.pyindex 73ca8c6a989..a94201a8377 100644--- a/hermes_cli/update_cmd_fleet.py+++ b/hermes_cli/update_cmd_fleet.py@@ -7,6 +7,7 @@ test patches on ``hermes_cli.update_cmd.<name>`` stay effective)."""import logging+from contextlib import suppressimport osimport subprocessimport sys@@ -14,6 +15,8 @@ import time as _timefrom dataclasses import dataclassfrom pathlib import Path+from hermes_cli.update_cmd_common import _best_effort+# Log-record parity with the origin module.logger = logging.getLogger("hermes_cli.update_cmd")@@ -21,10 +24,8 @@ logger = logging.getLogger("hermes_cli.update_cmd")def _write_gateway_update_exit_code(ok: bool) -> None:from hermes_cli.update_cmd import get_hermes_homepath = get_hermes_home() / ".update_exit_code"- try:+ with suppress(OSError):path.write_text("0" if ok else "1", encoding="utf-8")- except OSError:- pass# Lives under HERMES_HOME (not next to the venv). Unlike the venv-repair@@ -140,11 +141,9 @@ def _receipt_reports_stale_runtime(expected_sha: str | None = None) -> bool:def _pending_fleet_restart_needed() -> bool:"""True when a prior pull still owes the fleet a restart (#95294)."""- try:+ with suppress(OSError):if _fleet_restart_pending_marker_path().is_file():return True- except OSError:- passreturn _receipt_reports_stale_runtime()@@ -169,12 +168,10 @@ def _warn_pending_fleet_restart(*, startup: bool = False) -> None:def _warn_pending_fleet_restart_on_startup() -> None:"""Cheap CLI-startup hint. Never restarts; never raises."""- try:+ with suppress(Exception):if not _pending_fleet_restart_needed():return_warn_pending_fleet_restart(startup=True)- except Exception:- passdef _restart_systemd_gateway_units_best_effort(failed: list) -> None:@@ -222,10 +219,8 @@ def _run_pending_fleet_restart() -> bool:"""from hermes_cli.update_cmd import _mprint("→ Restarting gateways left on pre-update code...")- try:+ with suppress(Exception):_m()._purge_stale_hermes_modules()- except Exception:- passtry:from hermes_cli.gateway import (find_gateway_pids,@@ -275,11 +270,9 @@ def _run_pending_fleet_restart() -> bool:except Exception:leftover = list(pids or [])if leftover:- try:+ with _best_effort('Pending fleet restart: PID stop failed: %s'):kill_gateway_processes(all_profiles=True)_wait_for_gateway_exit(timeout=5.0, force_after=None)- except Exception as exc:- logger.debug("Pending fleet restart: PID stop failed: %s", exc)if failed:_warn_incomplete_gateway_fleet_restart(failed)return False@@ -650,7 +643,7 @@ def _gateway_recovery_partition(skip_profiles = skip_profiles or set()candidates: dict[str, str] = {}skipped: list[dict] = []- try:+ with _best_effort('Could not prepare fresh gateway restart profiles: %s'):for runtime in getattr(plan, "runtimes", ()) or ():kind = getattr(runtime, "kind", None)profile = getattr(runtime, "profile", None)@@ -703,8 +696,6 @@ def _gateway_recovery_partition("reason": reason,})- except Exception as exc:- logger.debug("Could not prepare fresh gateway restart profiles: %s", exc)return candidates, skipped@@ -850,10 +841,8 @@ def _restart_systemd_gateway_units(# Discover all hermes-gateway* units (default + profiles) plus# hermes-serve* units (the Desktop app's backend, #83438).if supports_systemd_services():- try:+ with suppress(Exception):_ensure_user_systemd_env()- except Exception:- passfor scope, scope_cmd in [("user", ["systemctl", "--user"]),@@ -1140,10 +1129,8 @@ def _restart_manual_gateways(pid, _drain_budget, proc.profile)if not drained:- try:+ with suppress(ProcessLookupError, PermissionError):os.kill(pid, _signal.SIGTERM)- except (ProcessLookupError, PermissionError):- pass# Wait up to 5s for the old process to exit before the watcher# respawns. Telegram keeps the old getUpdates session alive ~30s;# a new gateway connecting inside that window gets a 409 that@@ -1159,11 +1146,9 @@ def _restart_manual_gateways(for pid in manual_pids:if pid in profile_processes and pid not in unrestartable_pids:continue- try:+ with suppress(ProcessLookupError, PermissionError):os.kill(pid, _signal.SIGTERM)killed_pids.add(pid)- except (ProcessLookupError, PermissionError):- passif restarted_services or killed_pids:print()@@ -1198,7 +1183,7 @@ def _force_kill_stuck_gateways(killed_pids, *, find_gateway_pids, _get_service_p# never exit, so the 120s profile watcher never respawns and the# user keeps hitting ImportError on stale sys.modules. Give graceful# paths a moment, then SIGKILL remaining pre-update PIDs.- try:+ with _best_effort('Post-restart survivor sweep failed: %s'):_time.sleep(3.0)_service_pids_after = _get_service_pids(all_profiles=True)_surviving = find_gateway_pids(@@ -1218,7 +1203,7 @@ def _force_kill_stuck_gateways(killed_pids, *, find_gateway_pids, _get_service_pterminate_pid as _terminate_pid,)for pid in _stuck:- try:+ with suppress(ProcessLookupError, PermissionError, OSError):# taskkill /T /F on Windows, SIGKILL on POSIX —# _signal.SIGKILL doesn't exist on Windows._terminate_pid(@@ -1226,13 +1211,9 @@ def _force_kill_stuck_gateways(killed_pids, *, find_gateway_pids, _get_service_pforce=True,expected_start_time=_get_process_start_time(pid),)- except (ProcessLookupError, PermissionError, OSError):- pass# Give the OS a beat to reap the processes so the# watchers see them exit and respawn._time.sleep(1.5)- except Exception as _sweep_exc:- logger.debug("Post-restart survivor sweep failed: %s", _sweep_exc)def _recover_after_restart_phase_abort(@@ -1349,7 +1330,7 @@ def _recover_after_restart_phase_abort(_warn_stale_serve_runtimes(_stale_runtime_rows)if gateway_mode:_write_gateway_update_exit_code(False)- try:+ with suppress(Exception):from hermes_cli.update_receipt import record_gateway_restartrecord_gateway_restart(@@ -1362,8 +1343,6 @@ def _recover_after_restart_phase_abort(phase_error=str(e),fresh_recovery=_recovery_result,)- except Exception:- passreturn gateway_fleet_restart_incomplete@@ -1448,14 +1427,12 @@ def _restart_gateway_fleet_after_update(_pre_update_plan, gateway_mode: bool):# --- Launchd services (macOS): EVERY ai.hermes.gateway* LaunchAgent,# parity with systemd (#41403). Per-label TimeoutExpired isolation inside.if is_macos():- try:+ with suppress(FileNotFoundError, ImportError):_restart_macos_launchd_gateways(restarted_services,failed_or_stale_units,_drain_budget,)- except (FileNotFoundError, ImportError):- pass_restart_manual_gateways(_drain_budget,@@ -1476,7 +1453,7 @@ def _restart_gateway_fleet_after_update(_pre_update_plan, gateway_mode: bool):_write_gateway_update_exit_code(False)_warn_incomplete_gateway_fleet_restart(failed_or_stale_units)- try:+ with suppress(Exception):from hermes_cli.update_receipt import record_gateway_restartrecord_gateway_restart(@@ -1487,8 +1464,6 @@ def _restart_gateway_fleet_after_update(_pre_update_plan, gateway_mode: bool):failed_units=failed_or_stale_units,incomplete=bool(failed_or_stale_units),)- except Exception:- pass_force_kill_stuck_gateways(killed_pids, find_gateway_pids=find_gateway_pids, _get_service_pids=_get_service_pids@@ -1545,7 +1520,7 @@ def _verify_fleet_after_update()# Legacy hermes.service + hermes-gateway.service SIGTERM-fight over the# same bot token (PR #11909); warn on every update until migrated.- try:+ with _best_effort('Legacy unit check during update failed: %s'):from hermes_cli.gateway import (has_legacy_hermes_units,_find_legacy_hermes_units,@@ -1566,8 +1541,6 @@ def _verify_fleet_after_update(print(" hermes gateway migrate-legacy")print()print(" (add `sudo` if any are in system scope)")- except Exception as e:- logger.debug("Legacy unit check during update failed: %s", e)# Restart a managed dashboard via systemd or stop stale manual ones# (raw-killing a systemd-owned PID reads as a clean stop and leaves the@@ -1585,12 +1558,10 @@ def _verify_fleet_after_update(# Rows feed the reconciliation below (survivor → exit 1); ``None``# means the probe failed and reconciliation stays fail-closed._stale_serve_rows: "list | None" = None- try:+ with _best_effort('Failed to check for surviving serve runtimes: %s'):_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:")@@ -1601,7 +1572,7 @@ def _verify_fleet_after_update(# checkout and surface any gateway still serving pre-update code —# instead of assuming the restart phase worked (#88654, #69754)._fleet_snapshot: list = []- try:+ with _best_effort('Fleet version verification failed: %s'):from hermes_cli.update_receipt import (collect_fleet_versions,print_fleet_version_matrix,@@ -1660,14 +1631,12 @@ def _verify_fleet_after_update(" gateway runtimes were expected — verification incomplete.")restart.incomplete = True- except Exception as _fleet_exc:- logger.debug("Fleet version verification failed: %s", _fleet_exc)# Plan-vs-execution reconciliation (#91277): every runtime the PLAN saw# must appear in the restart bookkeeping; an unaccounted one is a# silent miss and escalates like a STALE/DOWN row._runtime_outcomes: list = []- try:+ with _best_effort('Runtime-outcome reconciliation failed: %s'):if _pre_update_plan is not None and _pre_update_plan.runtimes:from hermes_cli.update_inventory import (match_runtime_outcomes,@@ -1691,17 +1660,13 @@ def _verify_fleet_after_update()if report_unaccounted_runtimes(_runtime_outcomes):restart.incomplete = True- try:+ with suppress(Exception):import hermes_cli.update_receipt as _urif _ur._current is not None:_ur._current.data["runtime_outcomes"] = _runtime_outcomes- except Exception:- pass- except Exception as _outcome_exc:- logger.debug("Runtime-outcome reconciliation failed: %s", _outcome_exc)- try:+ with _best_effort('Update receipt finalize failed: %s'):from hermes_cli.update_receipt import finalize_update_receipt_receipt_path = finalize_update_receipt(@@ -1714,8 +1679,6 @@ def _verify_fleet_after_update()if _receipt_path is not None:logger.info("Update receipt written: %s", _receipt_path)- except Exception as _receipt_exc:- logger.debug("Update receipt finalize failed: %s", _receipt_exc)if restart.incomplete:# Code update itself succeeded, but at least one gateway still@@ -1800,11 +1763,9 @@ def _fleet_probe_expected_runtimes(return Trueif pre_restart_pids is None or pre_restart_pids:return True- try:+ with suppress(Exception):if pre_update_plan is not None and pre_update_plan.runtimes:return True- except Exception:- passreturn False@@ -1822,12 +1783,10 @@ def _wait_for_service_active("""deadline = _time.monotonic() + max(timeout, 0.5)while True:- try:+ with suppress(FileNotFoundError, subprocess.TimeoutExpired):_verify = _systemctl(scope_cmd_ + ["is-active", svc_name_], timeout=5)if _verify.stdout.strip() == "active":return True- except (FileNotFoundError, subprocess.TimeoutExpired):- passif _time.monotonic() >= deadline:return False_time.sleep(0.5)@@ -1865,10 +1824,8 @@ def _service_restart_sec(("s", 1.0),):if part.endswith(_suf):- try:+ with suppress(ValueError):total += float(part[: -len(_suf)]) * _multmatched = True- except ValueError:- passbreakreturn total if matched else defaultdiff --git a/hermes_cli/update_cmd_git.py b/hermes_cli/update_cmd_git.pyindex b15dd3a2fb8..9ef49a1eced 100644--- a/hermes_cli/update_cmd_git.py+++ b/hermes_cli/update_cmd_git.py@@ -6,6 +6,7 @@ test patches on ``update_cmd`` stay effective)."""import logging+from contextlib import suppressimport subprocessimport sysfrom datetime import datetime@@ -37,7 +38,7 @@ def _prune_orphan_rescue_refs(sort chronologically so ``for-each-ref`` order is creation order. Best-effort, never blocks."""from hermes_cli.update_cmd import _git_run- try:+ with suppress(OSError):list_result = _git_run(git_cmd,["for-each-ref", "--format=%(refname)", "--sort=refname",@@ -65,8 +66,6 @@ def _prune_orphan_rescue_refs(stale.add(ref)for ref in sorted(stale):_git_run(git_cmd, ["update-ref", "-d", ref], cwd)- except OSError:- passdef _branch_head_label(git_cmd=None, cwd=None) -> str | None:@@ -239,12 +238,10 @@ SKIP_UPSTREAM_PROMPT_FILE = ".skip_upstream_prompt"def _get_origin_url(git_cmd: list[str], cwd: Path) -> Optional[str]:"""Get the URL of the origin remote, or None if not set."""from hermes_cli.update_cmd import _git_run- try:+ with suppress(Exception):result = _git_run(git_cmd, ["remote", "get-url", "origin"], cwd)if result.returncode == 0:return result.stdout.strip()- except Exception:- passreturn None@@ -287,12 +284,10 @@ def _add_upstream_remote(git_cmd: list[str], cwd: Path) -> bool:def _count_commits_between(git_cmd: list[str], cwd: Path, base: str, head: str) -> int:"""Count commits on `head` that are not on `base`. Returns -1 on error."""from hermes_cli.update_cmd import _git_run- try:+ with suppress(Exception):result = _git_run(git_cmd, ["rev-list", "--count", f"{base}..{head}"], cwd)if result.returncode == 0:return int(result.stdout.strip())- except Exception:- passreturn -1@@ -305,12 +300,10 @@ def _should_skip_upstream_prompt() -> bool:def _mark_skip_upstream_prompt():"""Create marker file to skip future upstream prompts."""- try:+ with suppress(Exception):from hermes_constants import get_hermes_home(get_hermes_home() / SKIP_UPSTREAM_PROMPT_FILE).touch()- except Exception:- passdef _sync_fork_with_upstream(git_cmd: list[str], cwd: Path) -> bool:@@ -537,13 +530,11 @@ def _portable_git_candidates() -> list:not the profile-scoped HERMES_HOME), then profile home as a fallback for custom layouts."""from hermes_cli.update_cmd import get_default_hermes_root, get_hermes_homecandidates = []- try:+ with suppress(Exception):for root in (get_default_hermes_root(), Path(get_hermes_home())):candidates.append(root / "git" / "mingw64" / "libexec" / "git-core" / "git.exe")- except Exception:- passreturn candidates@@ -602,7 +593,7 @@ def _discard_lockfile_churn(git_cmd, repo_root):sees a clean tree instead of autostashing every run. Only touches lockfiles whosepackage.json is NOT also dirty. Best-effort."""from hermes_cli.update_cmd import _git_run- try:+ with suppress(Exception):diff = _git_run(git_cmd, ["diff", "--name-only"], repo_root)if diff.returncode != 0:return@@ -621,8 +612,6 @@ def _discard_lockfile_churn(git_cmd, repo_root):return_git_run(git_cmd, ["checkout", "--", *dirty], repo_root)print(f"→ Discarded npm lockfile churn ({len(dirty)} file(s))")- except Exception:- passdef _normalize_managed_eol(git_cmd, repo_root):@@ -678,7 +667,7 @@ def _normalize_managed_eol(git_cmd, repo_root):return Nonereturn all_dirty - real_dirty- try:+ with suppress(Exception):effective = _git_run(git_cmd, ["config", "--get", "core.autocrlf"], repo_root)# Only "true" rewrites LF->CRLF; unset/false/input leave the tree alone.if effective.stdout.strip().lower() != "true":@@ -709,5 +698,3 @@ def _normalize_managed_eol(git_cmd, repo_root):capture_output=True,check=False,)- except Exception:- passdiff --git a/hermes_cli/update_cmd_maint.py b/hermes_cli/update_cmd_maint.pyindex 1687178851f..f333f2f94e3 100644--- a/hermes_cli/update_cmd_maint.py+++ b/hermes_cli/update_cmd_maint.py@@ -6,6 +6,7 @@ test patches on ``update_cmd`` stay effective)."""import logging+from contextlib import suppressimport osimport shutilimport subprocess@@ -15,6 +16,8 @@ from pathlib import Pathfrom typing import Optionalfrom hermes_constants import venv_python_path+from hermes_cli.update_cmd_common import _best_effort+# Log-record parity with the origin module.logger = logging.getLogger("hermes_cli.update_cmd")@@ -62,7 +65,7 @@ def _purge_stale_hermes_modules() -> None:their module objects — so later imports rebuild a self-consistent graph from the new tree."""from hermes_cli.update_cmd import _m- try:+ with _best_effort('Could not purge stale Hermes modules: %s'):import importlibimportlib.invalidate_caches()@@ -82,15 +85,13 @@ def _purge_stale_hermes_modules() -> None:logger.debug("Purged %d stale Hermes module(s) after checkout update", len(purged))- except Exception as exc:- logger.debug("Could not purge stale Hermes modules: %s", exc)def _reload_updated_runtime_modules() -> None:"""Reload the modules used by lazy-backend refresh: the pre-pull process's cached modulescan expose old symbols despite new source on disk."""from hermes_cli.update_cmd import _m- try:+ with _best_effort('Could not refresh update runtime modules: %s'):import importlibimportlib.invalidate_caches()@@ -102,8 +103,6 @@ def _reload_updated_runtime_modules() -> None:importlib.reload(module)except Exception as exc:logger.debug("Could not reload updated module %s: %s", module_name, exc)- except Exception as exc:- logger.debug("Could not refresh update runtime modules: %s", exc)def _print_curator_first_run_notice() -> None:@@ -204,10 +203,8 @@ def _print_fts_optimize_available_notice() -> None:returnfinally:if db is not None:- try:+ with suppress(Exception):db.close()- except Exception:- passsql = (row[0] if row else "") or ""if not sql or ("tool_name" in sql and not interrupted):return@@ -272,11 +269,9 @@ def _print_curator_recent_run_notice() -> None:# Only a multi-line summary (rename map) is worth showing; still stamp it shown.if "\n" not in summary:- try:+ with suppress(Exception):state["last_run_summary_shown_at"] = last_run_atcurator.save_state(state)- except Exception:- passreturnwhen = _format_time_ago(last_run_at)@@ -289,11 +284,9 @@ def _print_curator_recent_run_notice() -> None:"View anytime: hermes curator status)")- try:+ with suppress(Exception):state["last_run_summary_shown_at"] = last_run_atcurator.save_state(state)- except Exception:- passdef _format_time_ago(iso_ts: str) -> str:@@ -614,13 +607,11 @@ def _verify_and_restore_state_dbs_post_update() -> None:from hermes_cli.update_cmd import get_hermes_homehome = get_hermes_home()_verify_and_restore_one_state_db(home, label="default home")- try:+ with _best_effort('Sibling-profile state.db guard sweep failed: %s'):from hermes_cli.backup import _sibling_profile_homesfor name, profile_home in _sibling_profile_homes(home):_verify_and_restore_one_state_db(profile_home, label=f"profile {name}")- except Exception as exc:- logger.debug("Sibling-profile state.db guard sweep failed: %s", exc)def _print_bundled_skills_sync_report() -> None:@@ -827,7 +818,7 @@ def _run_pre_update_backup(args) -> Optional[str]:return Nonesnapshot_id = None- try:+ with _best_effort('Pre-update snapshot failed: %s'):from hermes_cli.backup import (_quick_snapshot_root,create_quick_snapshot,@@ -888,7 +879,7 @@ def _run_pre_update_backup(args) -> Optional[str]:# The code swap + fleet restart touch EVERY profile, so each gets the same snapshot# under its own state-snapshots/. Best-effort per profile.- try:+ with _best_effort('Sibling profile snapshots failed: %s'):from hermes_cli.backup import create_pre_update_snapshots_all_profiles_sibling_snaps = create_pre_update_snapshots_all_profiles(@@ -911,12 +902,6 @@ def _run_pre_update_backup(args) -> Optional[str]:# The reader lives in update_cmd_config; write ITS module global, not ours._cfg._LAST_SIBLING_SNAPSHOTS = _sibling_snaps- except Exception as _sib_exc:- logger.debug(- "Sibling profile snapshots failed: %s", _sib_exc- )- except Exception as exc:- logger.debug("Pre-update snapshot failed: %s", exc)if mode != "full":if snapshot_id:@@ -1037,30 +1022,24 @@ def _run_post_update_maintenance(logger.debug("macOS TCC anchor refresh skipped", exc_info=True)# state.db integrity guard for root home AND every profile; restore from own snapshot.- try:+ with _best_effort('Post-update state.db integrity check failed: %s'):_verify_and_restore_state_dbs_post_update()- except Exception as exc:- logger.debug("Post-update state.db integrity check failed: %s", exc)# Seed the model-catalog cache from the checkout instead of a bot-gated, flaky fetch.- try:+ with _best_effort('Model catalog seed during update failed: %s'):from hermes_cli.model_catalog import seed_cache_from_checkoutif seed_cache_from_checkout(_m().PROJECT_ROOT):print(" ✓ Model catalog cache refreshed from checkout")- except Exception as e:- logger.debug("Model catalog seed during update failed: %s", e)- try:+ with _best_effort('Skills sync during update failed: %s'):print()print("→ Syncing bundled skills...")_print_bundled_skills_sync_report()- except Exception as e:- logger.debug("Skills sync during update failed: %s", e)# All profiles incl. the active one: seed_profile_skills() subprocesses with an explicit# HERMES_HOME, so sync_skills()'s module-level HERMES_HOME cache can't skew it.- try:+ with suppress(Exception):from hermes_cli.profiles import (list_profiles,seed_profile_skills,@@ -1092,12 +1071,10 @@ def _run_post_update_maintenance(print(f" {p.name}: {status}")except Exception as pe:print(f" {p.name}: error ({pe})")- except Exception:- pass # profiles module not available or no profiles# Backfill .env for profiles created before .env seeding (copy the default's) so they# keep the credentials they were effectively using.- try:+ with suppress(Exception):from hermes_cli.profiles import backfill_profile_envsbackfilled = backfill_profile_envs(quiet=True)@@ -1107,17 +1084,13 @@ def _run_post_update_maintenance(f"→ Seeded .env for {len(backfilled)} profile(s) "f"(copied from default): {', '.join(backfilled)}")- except Exception:- pass # profiles module not available or no profiles- try:+ with suppress(Exception):from plugins.memory.honcho.cli import sync_honcho_profiles_quietsynced = sync_honcho_profiles_quiet()if synced:print(f"\n-> Honcho: synced {synced} profile(s)")- except Exception:- pass # honcho plugin not installed or not configured_check_and_apply_config_migration(assume_yes=assume_yes,@@ -1132,45 +1105,33 @@ def _run_post_update_maintenance()# v23 FTS layout is opt-in (existing indexes untouched); surface the command here.- try:+ with _best_effort('FTS optimize notice failed: %s'):_print_fts_optimize_available_notice()- except Exception as e:- logger.debug("FTS optimize notice failed: %s", e)- try:+ with _best_effort('Curator first-run notice failed: %s'):_print_curator_first_run_notice()- except Exception as e:- logger.debug("Curator first-run notice failed: %s", e)- try:+ with _best_effort('Curator recent-run notice failed: %s'):_print_curator_recent_run_notice()- except Exception as e:- logger.debug("Curator recent-run notice failed: %s", e)- try:+ with _best_effort('FHS PATH guard check failed: %s'):_ensure_fhs_path_guard()- except Exception as e:- logger.debug("FHS PATH guard check failed: %s", e)- try:+ with _best_effort('hermes-acp launcher self-heal failed: %s'):_ensure_acp_launcher()- except Exception as e:- logger.debug("hermes-acp launcher self-heal failed: %s", e)# Windows launchers into the managed bin dir: in-checkout launchers were swept by the# autostash (--include-untracked) and updates never run install.ps1. No-op on POSIX.- try:+ with _best_effort('Windows bin launcher migration failed: %s'):from hermes_cli._install_repair import migrate_windows_bin_pathmigrate_windows_bin_path(_m().PROJECT_ROOT)- except Exception as e:- logger.debug("Windows bin launcher migration failed: %s", e)# cua-driver refresh, no-op unless on PATH; tied to update for a predictable cadence# without a per-launch GitHub API call.- try:+ with _best_effort('cua-driver refresh failed: %s'):refresh_cua_driver = True- try:+ with _best_effort('Could not read updates.refresh_cua_driver: %s'):from hermes_cli.config import load_config_update_cfg = (load_config() or {}).get("updates", {})@@ -1178,8 +1139,6 @@ def _run_post_update_maintenance(refresh_cua_driver = bool(_update_cfg.get("refresh_cua_driver", True))- except Exception as cfg_exc:- logger.debug("Could not read updates.refresh_cua_driver: %s", cfg_exc)if (refresh_cua_driver@@ -1198,6 +1157,4 @@ def _run_post_update_maintenance(require_confirmed_update=True,show_installer_progress=False,)- except Exception as e:- logger.debug("cua-driver refresh failed: %s", e)return update_completediff --git a/hermes_cli/update_cmd_windows.py b/hermes_cli/update_cmd_windows.pyindex 029036225ad..11cbe32ab28 100644--- a/hermes_cli/update_cmd_windows.py+++ b/hermes_cli/update_cmd_windows.py@@ -5,6 +5,7 @@ Origin helpers are imported lazily per function (no cycle; test patches on the o"""import logging+from contextlib import suppressimport osimport subprocessimport sys@@ -12,6 +13,8 @@ import time as _timefrom datetime import datetimefrom pathlib import Path+from hermes_cli.update_cmd_common import _best_effort+# Log-record parity with the origin module.logger = logging.getLogger("hermes_cli.update_cmd")@@ -64,11 +67,9 @@ def _wait_for_windows_update_gateway_exit(survivors: set[int] = set()for pid in remaining:- try:+ with suppress(Exception):if _pid_exists(pid):survivors.add(pid)- except Exception:- passreturn survivors@@ -84,7 +85,7 @@ def _self_and_non_gateway_ancestor_pids(psutil) -> set[int]:except Exception:_is_gw = Noneskip: set[int] = {os.getpid()}- try:+ with suppress(Exception):for anc in psutil.Process().parents():try:anc_cmdline = " ".join(anc.cmdline() or [])@@ -93,8 +94,6 @@ def _self_and_non_gateway_ancestor_pids(psutil) -> set[int]:if _is_gw is not None and anc_cmdline and _is_gw(anc_cmdline):continueskip.add(int(anc.pid))- except Exception:- passreturn skip@@ -361,10 +360,8 @@ def _leftover_pausable_gateway_pids(for pid, _name, cmdline in matches:argv = cmdlineif psutil is not None:- try:+ with suppress(Exception):argv = " ".join(psutil.Process(int(pid)).cmdline()) or cmdline- except Exception:- passif not _is_pausable_gateway(argv):return Nonepids.append(int(pid))@@ -718,7 +715,7 @@ def _desktop_owns_gateway_lifecycle() -> bool:ledger; fall back to the venv-holder scan. An orphaned control plane (supervisor gone) does not count."""from hermes_cli.update_cmd import _m- try:+ with _best_effort('Desktop-lifecycle ledger probe failed: %s'):from hermes_cli.process_identity import ledger_entries, spawner_is_deadfor entry in ledger_entries():@@ -726,8 +723,6 @@ def _desktop_owns_gateway_lifecycle() -> bool:continueif spawner_is_dead(entry) is False:return True- except Exception as exc:- logger.debug("Desktop-lifecycle ledger probe failed: %s", exc)try:import psutil@@ -986,19 +981,14 @@ def _pause_windows_gateways_for_update() -> dict | None:# until next login (resume only relaunches what was running). Cold-start after update.# Exception: Desktop owns the lifecycle — spawning ``gateway run`` beside it races# ports/state. The skip is ownership, not liveness.- try:+ with _best_effort('Could not check Desktop gateway-lifecycle ownership before update: %s'):if _desktop_owns_gateway_lifecycle():logger.debug("Skipping Windows gateway cold-start plan: ""Desktop owns gateway lifecycle")return None- except Exception as exc:- logger.debug(- "Could not check Desktop gateway-lifecycle ownership before update: %s",- exc,- )- try:+ with _best_effort('Could not check Windows gateway autostart state before update: %s'):from hermes_cli import gateway_windowsif gateway_windows.is_installed():@@ -1009,11 +999,6 @@ def _pause_windows_gateways_for_update() -> dict | None:"unmapped": [],"cold_start_if_installed": True,}- except Exception as exc:- logger.debug(- "Could not check Windows gateway autostart state before update: %s",- exc,- )return Noneprofiles: dict[str, int] = {}@@ -1054,13 +1039,11 @@ def _pause_windows_gateways_for_update() -> dict | None:if socket_acks:# A socket-paused gateway drains its ACTIVE TURN first; honor its declared# budget (+ teardown grace) so it isn't force-killed mid-turn.- try:+ with suppress(Exception):declared = max(float(a.get("drain_timeout") or 0.0) for a in socket_acks)drain_timeout = max(drain_timeout, declared + 10.0)- except Exception:- passprint(f" → {len(socket_acks)} gateway(s) ACKed socket pause; "f"waiting up to {int(drain_timeout)}s for graceful exit"@@ -1090,7 +1073,7 @@ def _pause_windows_gateways_for_update() -> dict | None:# already gone with its worker raises ProcessLookupError and is skipped.force_killed = []for pid in sorted(set(survivors).union(unmapped_pids).union(launcher_pids)):- try:+ with suppress(ProcessLookupError, PermissionError, OSError):pid_int = int(pid)terminate_pid(pid_int,@@ -1098,8 +1081,6 @@ def _pause_windows_gateways_for_update() -> dict | None:expected_start_time=get_process_start_time(pid_int),)force_killed.append(pid_int)- except (ProcessLookupError, PermissionError, OSError):- passif profiles:print(f" ✓ Paused gateway profile(s): {', '.join(sorted(profiles))}")@@ -1240,12 +1221,10 @@ def _cold_start_windows_gateway_after_update() -> bool:)# Persist vouched PIDs so a death AFTER updater exit (Job Object teardown) is# reported by the next CLI invocation. Best-effort.- try:+ with suppress(Exception):gateway_windows._write_start_attestation(ready_pids, "cold-start after update")- except Exception:- passreturn True@@ -1259,15 +1238,13 @@ def _refresh_windows_gateway_launchers() -> None:from hermes_cli.update_cmd import _mif not _m()._is_windows():return- try:+ with _best_effort('Could not refresh Windows gateway launchers after update: %s'):from hermes_cli import gateway_windowsif not gateway_windows.is_installed():returngateway_windows._write_task_script()print(" ✓ Refreshed Windows gateway launcher scripts")- except Exception as exc:- logger.debug("Could not refresh Windows gateway launchers after update: %s", exc)def _refresh_bootstrap_cache_scripts(branch: str = "main") -> None:@@ -1280,7 +1257,7 @@ def _refresh_bootstrap_cache_scripts(branch: str = "main") -> None:The .ps1 copy gets a UTF-8 BOM to match the cache format. Best-effort: never fails the update."""from hermes_cli.update_cmd import _m- try:+ with _best_effort('Could not refresh bootstrap-cache scripts after update: %s'):import re as _recache_dir = Path(_m().get_hermes_home()) / "bootstrap-cache"@@ -1314,8 +1291,6 @@ def _refresh_bootstrap_cache_scripts(branch: str = "main") -> None:" ✓ Refreshed installer bootstrap-cache script(s): "+ ", ".join(sorted(refreshed)))- except Exception as exc:- logger.debug("Could not refresh bootstrap-cache scripts after update: %s", exc)def _resume_windows_gateways_after_update(token: dict | None) -> None:@@ -1467,12 +1442,10 @@ def _resume_windows_gateways_after_update(token: dict | None) -> None:)# Persist vouched PIDs so a death AFTER updater exit is reported by the# next CLI invocation. Best-effort.- try:+ with suppress(Exception):gateway_windows._write_start_attestation(ready_pids, "post-update relaunch")- except Exception:- passtoken["resume_needed"] = False@@ -1506,16 +1479,10 @@ def _resume_windows_gateways_and_merge_outcome(outcome, _windows_gateway_resume,if isinstance(_windows_gateway_resume, dict):# Failed relaunches are absent from the token so they still surface. Best-effort.- try:+ with _best_effort('Could not merge Windows relaunch outcome into fleet reconciliation bookkeeping: %s'):for _win_profile in _windows_gateway_resume.get("relaunched_profiles") or []:if _win_profile not in outcome.relaunched_profiles:outcome.relaunched_profiles.append(_win_profile)- except Exception as _win_reconcile_exc:- logger.debug(- "Could not merge Windows relaunch outcome into fleet "- "reconciliation bookkeeping: %s",- _win_reconcile_exc,- )windows_restarted = list(_windows_gateway_resume.get("restarted_services") or [])@@ -1533,7 +1500,7 @@ def _resume_windows_gateways_and_merge_outcome(outcome, _windows_gateway_resume,if label not in outcome.failed_or_stale_units:outcome.failed_or_stale_units.append(label)- try:+ with suppress(Exception):from hermes_cli.update_receipt import record_gateway_restartrecord_gateway_restart(@@ -1548,8 +1515,6 @@ def _resume_windows_gateways_and_merge_outcome(outcome, _windows_gateway_resume,),phase_error="; ".join(outcome.phase_errors) or None,)- except Exception:- passdef _clear_windows_venv_holders_or_exit(args, gateway_mode: bool, _windows_gateway_resume):diff --git a/hermes_cli/update_cmd_zip.py b/hermes_cli/update_cmd_zip.pyindex 49f39646fc6..71d8025d01c 100644--- a/hermes_cli/update_cmd_zip.py+++ b/hermes_cli/update_cmd_zip.py@@ -7,6 +7,7 @@ test patches on ``hermes_cli.update_cmd.<name>`` stay effective)."""import logging+from contextlib import suppressimport osimport shutilimport subprocess@@ -14,6 +15,8 @@ import sysfrom pathlib import Pathfrom typing import Optional+from hermes_cli.update_cmd_common import _best_effort+# Log-record parity with the origin module.logger = logging.getLogger("hermes_cli.update_cmd")@@ -125,10 +128,8 @@ def _commit_staged_replacements(staged) -> None:if backup and os.path.isdir(backup):shutil.rmtree(backup, ignore_errors=True)elif backup and os.path.exists(backup):- try:+ with suppress(OSError):os.remove(backup)- except OSError:- passdef _zip_overlay_block_reason(@@ -534,53 +535,39 @@ def _update_via_zip(args, *, had_desktop_app_before_update: bool = False) -> boohad_desktop_app_before_update=had_desktop_app_before_update,)- try:+ with suppress(Exception):print("→ Syncing bundled skills...")_print_bundled_skills_sync_report()- except Exception:- pass# Seed the model-catalog disk cache from the freshly-unpacked checkout# (same rationale as the git-pull path in _cmd_update_impl). Non-fatal.- try:+ with _best_effort('Model catalog seed during zip update failed: %s'):from hermes_cli.model_catalog import seed_cache_from_checkoutif seed_cache_from_checkout(_m().PROJECT_ROOT):print(" ✓ Model catalog cache refreshed from checkout")- except Exception as e:- logger.debug("Model catalog seed during zip update failed: %s", e)# Post-update state.db integrity guard (#68474, #97994): root home AND# every sibling profile, each auto-restored from its own snapshot.- try:+ with _best_effort('Post-update state.db integrity check (zip path) failed: %s'):_verify_and_restore_state_dbs_post_update()- except Exception as exc:- logger.debug(- "Post-update state.db integrity check (zip path) failed: %s", exc- )update_complete = _print_update_summary(node_failures=node_failures,desktop_build_ok=desktop_build_ok,pre_update_version=pre_update_version,)- try:+ with _best_effort('Curator first-run notice failed: %s'):_print_curator_first_run_notice()- except Exception as e:- logger.debug("Curator first-run notice failed: %s", e)- try:+ with _best_effort('Curator recent-run notice failed: %s'):_print_curator_recent_run_notice()- except Exception as e:- logger.debug("Curator recent-run notice failed: %s", e)# Don't stop a working dashboard when the Node refresh failed — see the# git-update path for rationale (#30271)._finish_dashboard_update_cleanup(node_failures)- try:+ with _best_effort('Update receipt finalize (zip path) failed: %s'):from hermes_cli.update_receipt import finalize_update_receiptfinalize_update_receipt("success" if update_complete and not node_failures else "partial")- except Exception as _receipt_exc:- logger.debug("Update receipt finalize (zip path) failed: %s", _receipt_exc)return update_complete