The agent that grows with you
Python aiai-agentai-agentsanthropicchatgptclaudeclaude-codecodexhermeshermes-agentllmnous-researchopenai
fix(plugins): restart_required on every toggle surface; trim salvage to invariant tests
teknium1a8b3fe60acc6
diff --git a/apps/shared/src/gateway-contract.generated.ts b/apps/shared/src/gateway-contract.generated.tsindex b8449d245ef..bcda369a402 100644--- a/apps/shared/src/gateway-contract.generated.ts+++ b/apps/shared/src/gateway-contract.generated.ts@@ -3688,13 +3688,15 @@ export interface PluginsManageParams {ref?: string | null}export type PluginsAction = 'list' | 'toggle' | 'install' | 'update' | 'remove'-/** ``list`` → ``plugins`` + counts; ``toggle`` → ``ok``/``unchanged``/``name``/``plugin``; ``install`` → ``hermes_cli.plugins_cmd.dashboard_install_plugin``'s ok payload; ``update`` → ``ok``/``unchanged``/``sha``; ``remove`` → ``ok``/``name``. */+/** ``list`` → ``plugins`` + counts; ``toggle`` → ``ok``/``unchanged``/``restart_required``/``name`` (the canonical key written)/``plugin``; ``install`` → ``hermes_cli.plugins_cmd.dashboard_install_plugin``'s ok payload; ``update`` → ``ok``/``unchanged``/``sha``; ``remove`` → ``ok``/``name`` plus ``cleared_memory_provider`` when the removed plugin was the live ``memory.provider``. */export interface PluginsManageResult {plugins?: AgentPluginRow[] | nulluser_count?: number | nullbundled_count?: number | nullok?: boolean | nullunchanged?: boolean | null+ restart_required?: boolean | null+ cleared_memory_provider?: boolean | nullname?: string | nullplugin?: AgentPluginRow | nullplugin_name?: string | nulldiff --git a/apps/shared/src/gateway-contract.openrpc.json b/apps/shared/src/gateway-contract.openrpc.jsonindex 37dfeac885b..7c2a9ccc36f 100644--- a/apps/shared/src/gateway-contract.openrpc.json+++ b/apps/shared/src/gateway-contract.openrpc.json@@ -18323,7 +18323,7 @@},"PluginsManageResult": {"additionalProperties": false,- "description": "``list`` \u2192 ``plugins`` + counts; ``toggle`` \u2192 ``ok``/``unchanged``/``name``/``plugin``;\n``install`` \u2192 ``hermes_cli.plugins_cmd.dashboard_install_plugin``'s ok payload; ``update`` \u2192\n``ok``/``unchanged``/``sha``; ``remove`` \u2192 ``ok``/``name``.",+ "description": "``list`` \u2192 ``plugins`` + counts; ``toggle`` \u2192 ``ok``/``unchanged``/``restart_required``/``name``\n(the canonical key written)/``plugin``; ``install`` \u2192 ``hermes_cli.plugins_cmd.dashboard_install_plugin``'s\nok payload; ``update`` \u2192 ``ok``/``unchanged``/``sha``; ``remove`` \u2192 ``ok``/``name`` plus\n``cleared_memory_provider`` when the removed plugin was the live ``memory.provider``.","properties": {"plugins": {"anyOf": [@@ -18388,6 +18388,30 @@"default": null,"title": "Unchanged"},+ "restart_required": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ],+ "default": null,+ "title": "Restart Required"+ },+ "cleared_memory_provider": {+ "anyOf": [+ {+ "type": "boolean"+ },+ {+ "type": "null"+ }+ ],+ "default": null,+ "title": "Cleared Memory Provider"+ },"name": {"anyOf": [{diff --git a/hermes_cli/plugins_cmd.py b/hermes_cli/plugins_cmd.pyindex 9454f3d9806..b7c3b45caf9 100644--- a/hermes_cli/plugins_cmd.py+++ b/hermes_cli/plugins_cmd.py@@ -2079,7 +2079,9 @@ def dashboard_set_agent_plugin_enabled(name: str, *, enabled: bool) -> dict[str,changed = _activate_key(key, enable=enabled)if changed:_toggle_plugin_toolset(key, enable=enabled)- return {"ok": True, "name": key, "unchanged": not changed}+ # Config-only change: a running gateway/TUI scanned plugins once at start and will not pick it+ # up, so every UI can say so (the CLI prints "Takes effect on next session") — #71595/#54941.+ return {"ok": True, "name": key, "unchanged": not changed, "restart_required": changed}def _user_installed_plugin_dir(name: str) -> Optional[Path]:diff --git a/hermes_cli/web_routers/dashboard_ui.py b/hermes_cli/web_routers/dashboard_ui.pyindex 6b50ab18d28..b323fbf27de 100644--- a/hermes_cli/web_routers/dashboard_ui.py+++ b/hermes_cli/web_routers/dashboard_ui.py@@ -249,34 +249,17 @@ async def _named_plugin_action(request: Request, name: str, action: Callable[[staction(_validate_plugin_name(name)), fallback_error, rescan=rescan))-def _set_agent_plugin_enabled_with_restart_hint(name: str, *, enabled: bool) -> dict:- """Toggle an agent plugin, stamping ``restart_required`` on the ok result.-- Config-only change: running gateway/TUI processes scan plugins once at- start and won't pick this up, so tell the UI a restart is needed —- mirrors the CLI's "Takes effect on next session." (#54941). Contract:- every ok toggle result carries an explicit ``unchanged`` boolean (pinned- by test_real_toggle_always_reports_unchanged); a missing key errs on the- side of prompting a restart. Imported late so a test's monkeypatch on- ``plugins_cmd`` wins at call time.- """- from hermes_cli.plugins_cmd import dashboard_set_agent_plugin_enabled-- result = dashboard_set_agent_plugin_enabled(name, enabled=enabled)- if result.get("ok"):- result["restart_required"] = not result.get("unchanged", False)- return result--@router.post("/api/dashboard/agent-plugins/{name:path}/enable")async def post_agent_plugin_enable(request: Request, name: str):- return await _named_plugin_action(request, name, lambda n: _set_agent_plugin_enabled_with_restart_hint(n, enabled=True),+ from hermes_cli.plugins_cmd import dashboard_set_agent_plugin_enabled+ return await _named_plugin_action(request, name, lambda n: dashboard_set_agent_plugin_enabled(n, enabled=True),"Enable failed.", rescan=False)@router.post("/api/dashboard/agent-plugins/{name:path}/disable")async def post_agent_plugin_disable(request: Request, name: str):- return await _named_plugin_action(request, name, lambda n: _set_agent_plugin_enabled_with_restart_hint(n, enabled=False),+ from hermes_cli.plugins_cmd import dashboard_set_agent_plugin_enabled+ return await _named_plugin_action(request, name, lambda n: dashboard_set_agent_plugin_enabled(n, enabled=False),"Disable failed.", rescan=False)diff --git a/tests/hermes_cli/test_dashboard_plugin_toggle_restart_hint.py b/tests/hermes_cli/test_dashboard_plugin_toggle_restart_hint.pydeleted file mode 100644index 3199a67f930..00000000000--- a/tests/hermes_cli/test_dashboard_plugin_toggle_restart_hint.py+++ /dev/null@@ -1,128 +0,0 @@-"""Dashboard plugin toggle responses surface ``restart_required`` (#54941).--Plugin enable/disable writes config only — running gateway/TUI processes-scan plugins once at start and never see the change, so the dashboard must-tell the user a restart is needed (the CLI already prints "Takes effect on-next session."). These tests pin the endpoint-layer contract: a toggle that-changed state reports ``restart_required: true``; a no-op toggle reports-``restart_required: false``.--The underlying config write (``dashboard_set_agent_plugin_enabled``) is-stubbed — its own behaviour is covered by tests/hermes_cli/test_plugins_cmd-tests; here we only assert the HTTP layer's annotation.-"""--from __future__ import annotations--import pytest-from fastapi.testclient import TestClient--from hermes_cli import plugins_cmd, web_server-from hermes_cli.dashboard_auth import clear_providers---def loopback_client():- clear_providers()- prev_host = getattr(web_server.app.state, "bound_host", None)- prev_port = getattr(web_server.app.state, "bound_port", None)- prev_required = getattr(web_server.app.state, "auth_required", None)- web_server.app.state.bound_host = "127.0.0.1"- web_server.app.state.bound_port = 8080- web_server.app.state.auth_required = False- client = TestClient(- web_server.app,- base_url="http://127.0.0.1:8080",- headers={"X-Hermes-Session-Token": web_server._SESSION_TOKEN},- )- yield client- web_server.app.state.bound_host = prev_host- web_server.app.state.bound_port = prev_port- web_server.app.state.auth_required = prev_required---def _stub_toggle(monkeypatch, *, unchanged: bool):- calls = []-- def fake(name, *, enabled):- calls.append((name, enabled))- return {"ok": True, "name": "web/exa", "unchanged": unchanged}-- monkeypatch.setattr(- plugins_cmd, "dashboard_set_agent_plugin_enabled", fake- )- return calls---def test_enable_change_reports_restart_required(loopback_client, monkeypatch):- calls = _stub_toggle(monkeypatch, unchanged=False)- resp = loopback_client.post("/api/dashboard/agent-plugins/web/exa/enable")- assert resp.status_code == 200- body = resp.json()- assert body["ok"] is True- assert body["restart_required"] is True- assert calls == [("web/exa", True)]---def test_disable_change_reports_restart_required(loopback_client, monkeypatch):- calls = _stub_toggle(monkeypatch, unchanged=False)- resp = loopback_client.post("/api/dashboard/agent-plugins/web/exa/disable")- assert resp.status_code == 200- body = resp.json()- assert body["ok"] is True- assert body["restart_required"] is True- assert calls == [("web/exa", False)]---def test_noop_toggle_reports_no_restart(loopback_client, monkeypatch):- _stub_toggle(monkeypatch, unchanged=True)- resp = loopback_client.post("/api/dashboard/agent-plugins/web/exa/enable")- assert resp.status_code == 200- assert resp.json()["restart_required"] is False---def test_failed_toggle_has_no_restart_field(loopback_client, monkeypatch):- def fake(name, *, enabled):- return {"ok": False, "error": "Plugin 'nope' is not installed or bundled."}-- monkeypatch.setattr(- plugins_cmd, "dashboard_set_agent_plugin_enabled", fake- )- resp = loopback_client.post("/api/dashboard/agent-plugins/nope/disable")- assert resp.status_code == 400--- ("enabled_now", "toggle_to", "expect_unchanged"),- [- (True, True, True), # already enabled → no-op- (False, True, False), # actually enables- (False, False, True), # already disabled → no-op- (True, False, False), # actually disables- ],-)-def test_real_toggle_always_reports_unchanged(- monkeypatch, enabled_now, toggle_to, expect_unchanged-):- """Pin the ``unchanged`` contract of the REAL toggle the endpoint's- ``restart_required`` derivation depends on: every ``ok: True`` return- carries an explicit ``unchanged`` boolean. If a future refactor drops the- key on some path, the endpoint would misreport a no-op as- "restart required" — this test fails first."""- name = "web/exa"- en = {name} if enabled_now else set()- dis = set() if enabled_now else {name}- monkeypatch.setattr(plugins_cmd, "_resolve_plugin_key", lambda _n: _n)- monkeypatch.setattr(plugins_cmd, "_get_enabled_set", lambda: set(en))- monkeypatch.setattr(plugins_cmd, "_get_disabled_set", lambda: set(dis))- monkeypatch.setattr(plugins_cmd, "_set_plugin_enabled", lambda _n, enable: None)- monkeypatch.setattr(- plugins_cmd, "_toggle_plugin_toolset", lambda _n, enable: None- )-- result = plugins_cmd.dashboard_set_agent_plugin_enabled(- name, enabled=toggle_to- )-- assert result["ok"] is True- assert result["unchanged"] is expect_unchangeddiff --git a/tests/hermes_cli/test_deferred_platform_client_tools.py b/tests/hermes_cli/test_deferred_platform_client_tools.pyindex 67638f51d4f..245f8b691b8 100644--- a/tests/hermes_cli/test_deferred_platform_client_tools.py+++ b/tests/hermes_cli/test_deferred_platform_client_tools.py@@ -188,7 +188,7 @@ class TestA2AClientToolsInCliProcess:mgr = PluginManager()mgr.discover_and_load()- a2a = mgr._plugins.get("a2a-platform")+ a2a = mgr._plugins.get("platforms/a2a") # bundled platforms key by category path (#27548)assert a2a is not None, "bundled a2a platform plugin was not discovered"# The whole point of the deferral is preserved: the inbound adapter isdiff --git a/tests/hermes_cli/test_plugins_cmd_activation_keys.py b/tests/hermes_cli/test_plugins_cmd_activation_keys.pynew file mode 100644index 00000000000..b4228836445--- /dev/null+++ b/tests/hermes_cli/test_plugins_cmd_activation_keys.py@@ -0,0 +1,91 @@+"""Plugin activation writes and reads the SAME key on every surface (#27548, #73131, #82898).++Runs the real ``hermes_cli.plugins_cmd`` commands against a temp HERMES_HOME and checks the verdict+through the loader's own gate (``plugins_discovery.gate_manifest``) — never by re-reading the list+the command just wrote.+"""++from __future__ import annotations++import pytest++from hermes_cli import plugins_cmd+from hermes_cli.config import load_config, save_config+from hermes_cli.plugins_discovery import collect_directory_manifests, gate_manifest+++def _write_plugin(root, rel, name, extra=""):+ d = root / rel+ d.mkdir(parents=True)+ (d / "plugin.yaml").write_text(f"name: {name}\nversion: '1.0'\n{extra}", encoding="utf-8")+ (d / "__init__.py").write_text("def register(ctx):\n pass\n", encoding="utf-8")+ return d+++def home(tmp_path, monkeypatch):+ hermes_home = tmp_path / "hermes-home"+ (hermes_home / "plugins").mkdir(parents=True)+ (hermes_home / "config.yaml").write_text("plugins:\n enabled: []\n disabled: []\n", encoding="utf-8")+ monkeypatch.setenv("HERMES_HOME", str(hermes_home))+ return hermes_home+++def _lists():+ plugins = load_config().get("plugins") or {}+ return set(plugins.get("enabled") or []), set(plugins.get("disabled") or [])+++def test_disable_bundled_platform_by_manifest_name_gates_the_loader(home):+ """`hermes plugins disable photon-platform` must produce a key the loader's gate matches; the+ CLI wrote ``platforms/photon`` while discovery keyed the adapter ``photon-platform``."""+ plugins_cmd.cmd_disable("photon-platform")++ enabled, disabled = _lists()+ photon = next(m for m in collect_directory_manifests() if m.name == "photon-platform")+ gate = gate_manifest(photon, disabled, enabled)+ assert gate.action == "placeholder" and gate.error == "disabled via config"+ # And the key the CLI persists IS the loader's key — not merely an alias of it.+ assert photon.key in disabled+++def test_dashboard_toggle_writes_canonical_key_and_clears_stale_aliases(home):+ """A toggle by bare leaf or manifest name must land on the canonical key; a stale key in+ ``disabled`` outranks a manifest-name entry in ``enabled``, so writing the raw identifier+ reported success while the plugin stayed off."""+ _write_plugin(home / "plugins", "obs/zzprobe", "zz-probe-manifest")+ cfg = load_config()+ cfg["plugins"]["disabled"] = ["obs/zzprobe"]+ save_config(cfg)++ result = plugins_cmd.dashboard_set_agent_plugin_enabled("zzprobe", enabled=True)++ assert result == {"ok": True, "name": "obs/zzprobe", "unchanged": False, "restart_required": True}+ enabled, disabled = _lists()+ assert enabled == {"obs/zzprobe"} and disabled == set()+ manifest = next(m for m in collect_directory_manifests() if m.name == "zz-probe-manifest")+ assert gate_manifest(manifest, disabled, enabled).action == "load"+ # Same state requested again by manifest name: nothing to write, no restart to announce.+ again = plugins_cmd.dashboard_set_agent_plugin_enabled("zz-probe-manifest", enabled=True)+ assert again["unchanged"] is True and again["restart_required"] is False+++def test_status_reports_bundled_defaults_and_the_live_memory_provider(home):+ """Bundled backends (auto-load) and the plugin selected by ``memory.provider`` run without a+ ``plugins.enabled`` entry; status must not call them "not enabled" (#73131, #82898)."""+ _write_plugin(home / "plugins", "fakemem", "fakemem", "kind: exclusive\n")+ cfg = load_config()+ cfg["memory"] = {"provider": "fakemem"}+ save_config(cfg)+ enabled, disabled = plugins_cmd._get_enabled_set(), plugins_cmd._get_disabled_set()+ active = plugins_cmd._category_active_names()++ by_key = {e[5]: e for e in plugins_cmd._discover_all_plugins()}+ for key in ("web/firecrawl", "fakemem"):+ name, _v, _d, source, dir_path, _k = by_key[key]+ status = plugins_cmd._plugin_status(name, enabled, disabled, key=key, source=source, dir_path=dir_path,+ active=active)+ assert status == "enabled", key+ # An explicit disable still wins over both defaults.+ assert plugins_cmd._plugin_status("fakemem", enabled, {"fakemem"}, key="fakemem", source="user",+ active=active) == "disabled"diff --git a/tests/hermes_cli/test_plugins_cmd_remove_bookkeeping.py b/tests/hermes_cli/test_plugins_cmd_remove_bookkeeping.pynew file mode 100644index 00000000000..f226ae09f8d--- /dev/null+++ b/tests/hermes_cli/test_plugins_cmd_remove_bookkeeping.py@@ -0,0 +1,73 @@+"""``plugins remove`` (CLI, dashboard, ``plugins.manage`` RPC) leaves no config residue and never+follows a symlink (#54336, plugin-scan L2-F1/F2/F5).++Real removal core against a temp HERMES_HOME; the RPC path goes through ``tui_gateway.server``.+"""++from __future__ import annotations++import pytest+import yaml++from hermes_cli import plugins_cmd+from tui_gateway import server+++def _write_plugin(root, rel, name, extra=""):+ d = root / rel+ d.mkdir(parents=True)+ (d / "plugin.yaml").write_text(f"name: {name}\nversion: '1.0'\n{extra}", encoding="utf-8")+ (d / "__init__.py").write_text("def register(ctx):\n pass\n", encoding="utf-8")+ return d+++def home(tmp_path, monkeypatch):+ hermes_home = tmp_path / "hermes-home"+ (hermes_home / "plugins").mkdir(parents=True)+ monkeypatch.setenv("HERMES_HOME", str(hermes_home))+ return hermes_home+++def _config(home):+ return yaml.safe_load((home / "config.yaml").read_text(encoding="utf-8")) or {}+++def test_remove_forgets_every_config_trace_and_resets_the_memory_provider(home):+ """After an uninstall, plugins.enabled/disabled/entries no longer name the plugin (a reinstall+ must start from the "Enable now?" decision) and a ``memory.provider`` pointing at it is reset —+ otherwise the next agent init re-clones the provider from the catalog, undoing the uninstall."""+ _write_plugin(home / "plugins", "fakemem", "fakemem", "kind: exclusive\n")+ (home / "config.yaml").write_text(yaml.safe_dump({+ "plugins": {"enabled": ["fakemem", "keep-me"], "disabled": ["other"],+ "entries": {"fakemem": {"allow_tool_override": True}, "keep-me": {}}},+ "memory": {"provider": "fakemem"},+ }), encoding="utf-8")++ resp = server.handle_request({"id": "1", "method": "plugins.manage",+ "params": {"action": "remove", "name": "fakemem"}})++ assert resp["result"] == {"ok": True, "name": "fakemem", "cleared_memory_provider": True}+ assert not (home / "plugins" / "fakemem").exists()+ cfg = _config(home)+ assert cfg["plugins"]["enabled"] == ["keep-me"] and cfg["plugins"]["disabled"] == ["other"]+ assert cfg["plugins"]["entries"] == {"keep-me": {}}+ assert not cfg["memory"]["provider"]+++def test_remove_of_a_symlink_inside_the_plugins_dir_unlinks_only_the_link(home):+ """A dev alias pointing at a sibling install resolves INSIDE the plugins dir, so the containment+ check passes; removing the alias must not delete the sibling (or its install metadata)."""+ victim = _write_plugin(home / "plugins", "victim", "victim")+ (home / "plugins" / "alias").symlink_to(victim, target_is_directory=True)+ (home / "plugins" / ".install-metadata.json").write_text('{"victim": {"pinned_sha": "%s"}}' % ("a" * 40),+ encoding="utf-8")+ (home / "config.yaml").write_text("plugins:\n enabled: [victim]\n", encoding="utf-8")++ result = plugins_cmd.dashboard_remove_user_plugin("alias")++ assert result == {"ok": True, "name": "alias"}+ assert not (home / "plugins" / "alias").is_symlink()+ assert (victim / "plugin.yaml").exists()+ assert "victim" in (home / "plugins" / ".install-metadata.json").read_text(encoding="utf-8")+ assert _config(home)["plugins"]["enabled"] == ["victim"]diff --git a/tests/plugins/memory/test_disabled_provider_not_loaded.py b/tests/plugins/memory/test_disabled_provider_not_loaded.pynew file mode 100644index 00000000000..4ea8832127d--- /dev/null+++ b/tests/plugins/memory/test_disabled_provider_not_loaded.py@@ -0,0 +1,50 @@+"""A user-installed memory provider parked in ``plugins.disabled`` must not load.++The Plugins hub / `hermes plugins disable` write the deny-list; ``plugins/memory`` never read it, so+the UI said "disabled" while the provider kept loading at every agent init.+"""++from __future__ import annotations++import pytest++from plugins.memory import find_provider_dir, load_memory_provider++_PROVIDER = """+from agent.memory_provider import MemoryProvider++class P(MemoryProvider):+ name = "fakemem"+ def is_available(self):+ return True+ def initialize(self, *a, **kw):+ pass+ def get_tool_schemas(self):+ return []++def register(ctx):+ ctx.register_memory_provider(P())+"""+++def home(tmp_path, monkeypatch):+ hermes_home = tmp_path / "hermes-home"+ d = hermes_home / "plugins" / "fakemem"+ d.mkdir(parents=True)+ (d / "plugin.yaml").write_text("name: fakemem-manifest\nkind: exclusive\n", encoding="utf-8")+ (d / "__init__.py").write_text(_PROVIDER, encoding="utf-8")+ monkeypatch.setenv("HERMES_HOME", str(hermes_home))+ return hermes_home+++def test_disabled_user_provider_is_found_but_never_loaded(home):+ (home / "config.yaml").write_text("memory:\n provider: fakemem\nplugins:\n disabled: [fakemem-manifest]\n",+ encoding="utf-8")+ # Still discoverable (installed, so no catalog re-clone at startup) ...+ assert find_provider_dir("fakemem") == home / "plugins" / "fakemem"+ # ... but the deny-list wins over memory.provider, under the manifest-name spelling the CLI writes.+ assert load_memory_provider("fakemem") is None++ (home / "config.yaml").write_text("memory:\n provider: fakemem\nplugins:\n disabled: []\n", encoding="utf-8")+ assert load_memory_provider("fakemem") is not Nonediff --git a/tui_gateway/contracts/tools_mcp_plugins.py b/tui_gateway/contracts/tools_mcp_plugins.pyindex e41f2c13917..24f75877dbb 100644--- a/tui_gateway/contracts/tools_mcp_plugins.py+++ b/tui_gateway/contracts/tools_mcp_plugins.py@@ -613,15 +613,18 @@ class AgentPluginRow(Result):class PluginsManageResult(Result):- """``list`` → ``plugins`` + counts; ``toggle`` → ``ok``/``unchanged``/``name``/``plugin``;- ``install`` → ``hermes_cli.plugins_cmd.dashboard_install_plugin``'s ok payload; ``update`` →- ``ok``/``unchanged``/``sha``; ``remove`` → ``ok``/``name``."""+ """``list`` → ``plugins`` + counts; ``toggle`` → ``ok``/``unchanged``/``restart_required``/``name``+ (the canonical key written)/``plugin``; ``install`` → ``hermes_cli.plugins_cmd.dashboard_install_plugin``'s+ ok payload; ``update`` → ``ok``/``unchanged``/``sha``; ``remove`` → ``ok``/``name`` plus+ ``cleared_memory_provider`` when the removed plugin was the live ``memory.provider``."""plugins: list[AgentPluginRow] | None = Noneuser_count: int | None = Nonebundled_count: int | None = Noneok: bool | None = Noneunchanged: bool | None = None+ restart_required: bool | None = None+ cleared_memory_provider: bool | None = Nonename: str | None = Noneplugin: AgentPluginRow | None = Noneplugin_name: str | None = Nonediff --git a/tui_gateway/methods_tools.py b/tui_gateway/methods_tools.pyindex abb6dbb3bb8..fb0c74c8b82 100644--- a/tui_gateway/methods_tools.py+++ b/tui_gateway/methods_tools.py@@ -1483,7 +1483,8 @@ def _plugins_toggle(rid, params):# The toggle resolves a bare leaf / manifest name to the canonical key it wrote; report that key.key = result.get("name") or identrow = next((r for r in _plugin_rows() if key in (r["key"], r["name"])), None)- return _ok(rid, {"ok": True, "unchanged": bool(result.get("unchanged")), "name": key, "plugin": row})+ return _ok(rid, {"ok": True, "unchanged": bool(result.get("unchanged")),+ "restart_required": bool(result.get("restart_required")), "name": key, "plugin": row})def _plugins_install(rid, params):