Files
Teknium 21aa99db8c fix(update): retired updater shims never start an update from live code
Every retired shim called stop_for_relaunch() unconditionally, so a current-tree
caller (a plugin, a serve/dashboard/gateway, main.__getattr__'s lazy export)
reaching one ran the whole update-finish takeover: dependency sync, desktop
rebuild, gateway restart, backend kill -- and the restarted process could reach
the shim again (#122656). lazy_deps.install_specs and psutil_android's import
were already gated on in_historical_update(); the other 60 shims were not.

One shared gate, _old_updater.stop_historical_updater(hook, error): hands off
exactly as before when a historical updater entrypoint frame is on the stack
(or the process already handed off and is unwinding), otherwise raises a
catchable error (ImportError for installer-shaped shims, matching
install_specs; RetiredUpdaterHook otherwise). install_specs now uses it too.
main._write_update_incomplete_marker resolves to a gated old_updater_deps shim
instead of aliasing stop_for_relaunch. Every frozen-surface name is retained.

Fixes #124881
Fixes #122656
2026-11-14 01:03:00 -08:00

11 lines
380 B
Python

"""Stop an already-running old updater before its retired npm retry path."""
from typing import NoReturn
from hermes_cli._old_updater import stop_historical_updater
def maybe_repair_npm_engine(*args, **kwargs) -> NoReturn:
# Returning would let old callers retry or continue their stale update.
stop_historical_updater("hermes_cli.npm_engine.maybe_repair_npm_engine")