Skip to content

The agent that grows with you

Merge remote-tracking branch 'origin/main' into ethie/pm-clean

ethernet1f48a3d0364a
diff --cc hermes_cli/plugins_cmd.py
index 35ac45e1c5c,1c0fa816740..cc6bf8a3022
--- a/hermes_cli/plugins_cmd.py
+++ b/hermes_cli/plugins_cmd.py
@@@ -1401,8 -1279,10 +1403,10 @@@ def cmd_enable(name: str, allow_tool_ov
except PluginOperationError as exc:
_fail(console, f"[red]Error:[/red] {exc}")
- if _activate_key(key, enable=True):
+ if _activate_key(key, enable=True, console=console):
+ from hermes_cli.plugins_activation import activate_plugin_now, activation_hint
console.print(f"[green]✓[/green] Plugin [bold]{key}[/bold] enabled. Takes effect on next session.")
+ console.print(f"[dim]{activation_hint(activate_plugin_now(key, in_process=False))}[/dim]")
else:
console.print(f"[dim]Plugin '{key}' is already enabled.[/dim]")
@@@ -2346,17 -2031,14 +2350,22 @@@ def dashboard_install_plugin
return {"ok": False, "error": str(exc)}
if enable:
- _set_plugin_enabled(installed_name, enable=True)
- deps = _install_python_dependencies_quietly(target, warnings)
+ from hermes_cli.plugins_admission import AdmissionRefused
+
+ try:
+ _set_plugin_enabled(installed_name, enable=True)
+ except AdmissionRefused as exc:
+ return {
+ "ok": False, "error": f"enable refused: {exc}",
+ "plugin_name": installed_name, "enabled": False,
+ }
+ deps = _python_dependency_summary(target, warnings)
ap = target / "after-install.md"
+ # Deps first, then load: the plugin activates in this process (TUI/Desktop server subscribers see it)
+ # and in the running gateway; ``activation`` says what is live now vs next session (#87770).
+ from hermes_cli.plugins_activation import activate_plugin_now
+ activated = activate_plugin_now(installed_name) if enable else {
+ "gateway_reloaded": False, "activation": None, "restart_required": False}
return {
"ok": True, "plugin_name": installed_name, "warnings": warnings,
"python_dependencies": deps,
@@@ -2436,22 -2118,16 +2445,27 @@@ def dashboard_set_agent_plugin_enabled(
key = _resolve_plugin_key(name)
if key is None:
return {"ok": False, "error": f"Plugin '{name}' is not installed or bundled."}
- changed = _activate_key(key, enable=enabled)
+ from hermes_cli.plugins_admission import AdmissionRefused
+
+ try:
+ changed = _activate_key(key, enable=enabled)
+ except AdmissionRefused as exc:
+ return {
+ "ok": False,
+ "error": str(exc),
+ "name": key,
+ "unchanged": True,
+ "restart_required": False,
+ }
if changed:
_toggle_plugin_toolset(key, enable=enabled)
- # 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.
+ if changed and enabled:
+ # Load it now, here and in the running gateway; ``activation`` tells the UI what is live vs
+ # deferred, and ``restart_required`` only survives when no gateway answered (#87770).
+ from hermes_cli.plugins_activation import activate_plugin_now
+ return {"ok": True, "name": key, "unchanged": False, **activate_plugin_now(key)}
+ # Disable is config-only: there is no un-wire primitive, so a running gateway keeps the plugin's
+ # handlers until restart and every UI says so — #71595/#54941.
return {"ok": True, "name": key, "unchanged": not changed, "restart_required": changed}
@@@ -2479,9 -2155,11 +2493,11 @@@ def dashboard_update_user_plugin(name:
target, sidecar, consent_cb=(lambda _delta: True) if accept_capabilities else None)
warnings = list(result.warnings)
new_target = target.parent / result.installed_name
- deps = _install_python_dependencies_quietly(new_target, warnings) if result.changed else []
+ deps = _python_dependency_summary(new_target, warnings) if result.changed else []
+ from hermes_cli.plugins_activation import activate_plugin_now
+ activated = activate_plugin_now(result.installed_name) if result.changed else {}
return {"ok": True, "name": result.installed_name, "sha": result.sha, "unchanged": not result.changed,
- "python_dependencies": deps, "warnings": warnings}
+ "python_dependencies": deps, "warnings": warnings, **activated}
msg = _pull_plugin_update(
target,
lambda rec: (