Let $p(X)\in \mathbb Z[X]$ be a given integral polynomial with no real zeros. The roots of $p$ comes in conjugate pairs, so we can write $p(X)=q(X)q^*(X)$ in $\mathbb C[X]$, such that $q$ is the product of roots of $p$ which lies in the upper half plane, and $q^*$ is the conjugate (by coefficient) of $q$.
Is there an algorithm to determine the minimal extension of $\mathbb Q$ to get $q$, without involving larger extensions?
For example, if $p(X)=1+X^6(2+X^2)^3$, then $$ q(X)=\frac{1}{4} i (X+i)^2 \left(-2 X^2+\left(\sqrt[4]{3} (-1-i)+3^{3/4} (1-i)\right) X+i \sqrt{3}+1\right) \left(-2 X^2-\left(\sqrt[4]{3} (-1+i)+3^{3/4} (1+i)\right) X-i \sqrt{3}+1\right). $$ One may check that all roots of $q$ lies in the upper half plane, and $p=qq^*$. Hence, the desired extension for this polynomial is $\mathbb Q(\sqrt{-1},\sqrt[4]{3})$. This is much smaller than the splitting field of $p$.
The reason why I am interested in this question is that if such method exist, then we are able to evaluate certain rational integrals faster. The method is described here.
I am aware that this is not purely an algebraic question since we cannot distinguish complex roots related by conjugates algebraically. Of course, brute force can always do the job, but this turns out to be too slow to fit the purpose, and involves the whole splitting field. I am also aware of methods detecting whether all roots of a polynomial lies in certain regions, but that does not directly solve the problem.