diff --git a/hermes_cli/doctor.py b/hermes_cli/doctor.py index 87791d71fae..2998a31e0d4 100644 --- a/hermes_cli/doctor.py +++ b/hermes_cli/doctor.py @@ -1585,11 +1585,20 @@ def run_doctor(args): # glob (which pulls in Electron, node-pty, etc.) is never resolved # for a routine security check. The web and ui-tui workspaces are # audited separately via --workspace flags. See #38772. + # The WhatsApp bridge may live under a writable HERMES_HOME mirror + # instead of the (possibly read-only) install tree in Docker — resolve + # it through the shared helper so we audit the dir that actually holds + # node_modules. See #49561. + try: + from gateway.platforms.whatsapp_common import resolve_whatsapp_bridge_dir + _whatsapp_bridge_dir = resolve_whatsapp_bridge_dir() + except Exception: + _whatsapp_bridge_dir = PROJECT_ROOT / "scripts" / "whatsapp-bridge" npm_audit_targets = [ (PROJECT_ROOT, "Browser tools (agent-browser)", ["--workspaces=false"]), (PROJECT_ROOT, "web workspace", ["--workspace", "web"]), (PROJECT_ROOT, "ui-tui workspace", ["--workspace", "ui-tui"]), - (PROJECT_ROOT / "scripts" / "whatsapp-bridge", "WhatsApp bridge", []), + (_whatsapp_bridge_dir, "WhatsApp bridge", []), ] for npm_dir, label, audit_extra in npm_audit_targets: # For workspace-scoped audits run from PROJECT_ROOT the