From cefa573b242b0923cbdec5dd049f6bdbc5ea73ba Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Fri, 27 Nov 2026 12:38:28 -0800 Subject: [PATCH] fix(plugins): the kept-off notice names the plugins.disabled spelling it found An unattended install's enable vetoes every alias of the plugin, a core-era key included (platforms/weixin, weixin-platform, platforms/yuanbao), but kept_off_sentence always said "plugins.disabled lists ''", which a home that disabled the old key does not hold. It now quotes the entry the list actually holds; `hermes plugins enable ` still purges every alias. Seen live on the Weixin disabled-legacy-name home (r18 leg D). --- hermes_cli/memory_provider_migration.py | 9 +++++++-- tests/hermes_cli/test_left_core_weixin.py | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/hermes_cli/memory_provider_migration.py b/hermes_cli/memory_provider_migration.py index 06dd70be4f..15a5235234 100644 --- a/hermes_cli/memory_provider_migration.py +++ b/hermes_cli/memory_provider_migration.py @@ -234,9 +234,14 @@ def _profile_command(command: str, home: Path) -> str: def kept_off_sentence(name: str, home: Path) -> str: """Why an automatic install left *name* off in *home* (its ``plugins.disabled`` named it when the - enable ran, :func:`_install_into`), and the command that turns it on.""" + enable ran, :func:`_install_into`), and the command that turns it on. Names the spelling the list holds: + the enable vetoes every alias, a core-era key (``platforms/weixin``) included, which the enable purges.""" + from hermes_cli.plugins_cmd import _plugin_aliases + from pm.plugins_state import read_home_selection + disabled = ((read_home_selection(home) or {}).get("plugins") or {}).get("disabled") or () + listed = next((str(n) for n in disabled if str(n) in _plugin_aliases(name, entries=[])), name) enable = _install_command(name, home).replace(" plugins install ", " plugins enable ") - return f"plugins.disabled lists '{name}', so it is installed but off: run `{enable}` to turn it on." + return f"plugins.disabled lists '{listed}', so it is installed but off: run `{enable}` to turn it on." def _install_pending(home: Path, name: str, *, install: Callable[[str], dict], diff --git a/tests/hermes_cli/test_left_core_weixin.py b/tests/hermes_cli/test_left_core_weixin.py index dfbc008228..ffd3939702 100644 --- a/tests/hermes_cli/test_left_core_weixin.py +++ b/tests/hermes_cli/test_left_core_weixin.py @@ -176,4 +176,5 @@ def test_a_core_era_disable_keeps_weixin_off_through_both_installers(tmp_path, p plugins = (yaml.safe_load((home / "config.yaml").read_text(encoding="utf-8")) or {}).get("plugins") or {} assert plugins.get("disabled") == [name], f"the core-era disable was lifted: {plugins}" assert "weixin" not in (plugins.get("enabled") or []), plugins - assert any("installed but off" in line and "plugins enable weixin`" in line for line in said), said + assert any(f"plugins.disabled lists '{name}', so it is installed but off" in line + and "plugins enable weixin`" in line for line in said), said