  For a Galois extension $K/\mathbb{F}_q(t)$ of Galois group $\Gamma$ with
$\gcd(q,|\Gamma|)=1$, we define an invariant $\omega_K$, and show that it
determines the Weil pairing of the curve corresponding to $K$ and it descends
to the prime-to-$|\Gamma|$-torsion part of the lifting invariants of Hurwitz
schemes introduced by Ellenberg--Venkatesh--Westerland and Wood. By keeping
track of the image of $\omega_K$, we compute, as $K$ varies and $q\to \infty$,
the average number of surjections from the Galois group of maximal unramified
extension of $K$ to $H$, for any $\Gamma$-group $H$ whose order is prime to
$q|\Gamma|$. Motivated by this result, we modify the conjecture of Wood,
Zureick-Brown and the author about non-abelian Cohen--Lenstra, for both
function fields and number fields, to cover the cases when the base field
contains extra roots of unity. We also discuss how to use the invariant
$\omega_K$ to construct a random group model, and prove in a special case that
the model produces the same moments as our function field result.
