From 42729775db5bf60bf83003baed326f833a635e11 Mon Sep 17 00:00:00 2001 From: Ben Date: Sat, 23 May 2026 15:00:12 +1000 Subject: [PATCH] fix(dashboard): trigger plugin discovery in cmd_dashboard before start_server The argparse-setup plugin discovery path is gated on _plugin_cli_discovery_needed(), which returns False for any built-in subcommand including 'dashboard' (to save ~500ms startup on hot paths like --tui). As a result, plugins/dashboard_auth/nous never registered its DashboardAuthProvider, and start_server's fail-closed gate check tripped for any non-loopback bind even when the Nous provider was bundled and ready to run. Call discover_plugins() explicitly in cmd_dashboard so the provider registry is populated before the gate check runs. discover_plugins() is idempotent (per its docstring), so this is safe to call regardless of whether the argparse path already ran it. --- hermes_cli/main.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index 264f678add1..8bda836623d 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -10735,6 +10735,22 @@ def cmd_dashboard(args): sys.exit(1) print(f"→ Skipping web UI build (--skip-build); using dist at {_dist_root}") + # Discover and load plugins so any DashboardAuthProvider plugin + # (e.g. plugins/dashboard_auth/nous) registers BEFORE start_server's + # fail-closed gate check runs. The top-level argparse setup skips + # plugin discovery for built-in subcommands like ``dashboard`` to + # save ~500ms startup; we have to trigger it explicitly here because + # the dashboard's server-side runtime depends on plugin-registered + # providers (image_gen, web, dashboard_auth, …). + try: + from hermes_cli.plugins import discover_plugins + discover_plugins() + except Exception as exc: + # Discovery failures must not block dashboard startup outright — + # log and proceed; the gate's fail-closed branch will surface + # the missing-provider state if it matters. + print(f"⚠ Plugin discovery failed: {exc}", file=sys.stderr) + from hermes_cli.web_server import start_server embedded_chat = args.tui or os.environ.get("HERMES_DASHBOARD_TUI") == "1"