4. Let $x_{1}, x_{2}$ be the roots of the equation for $x(x \in \mathbf{C})$
$$
x^{2}-3 \sin \theta \cdot x+\sin ^{2} \theta+1=0(\theta \in[0, \pi))
$$

and $\left|x_{1}\right|+\left|x_{2}\right|=2$. Then $\theta=$ $\qquad$
4. 0 .

Notice,
$$
\Delta=9 \sin ^{2} \theta-4\left(\sin ^{2} \theta+1\right)=5 \sin ^{2} \theta-4 \text {. }
$$
(1) If $\Delta \geqslant 0$.

From $x_{1} x_{2}=\sin ^{2} \theta+1>0$, we know
$$
\begin{array}{l}
\left|x_{1}\right|+\left|x_{2}\right|=\left|x_{1}+x_{2}\right| \\
=|3 \sin \theta|=3 \sin \theta=2 \\
\Rightarrow \sin \theta=\frac{2}{3} .
\end{array}
$$

At this time, $\Delta<0$, discard.
(2) If $\Delta \leqslant 0$.

From $x_{1}=\overline{x_{2}} \Rightarrow\left|x_{1}\right|=\left|x_{2}\right|$.
Also, $\left|x_{1}\right|+\left|x_{2}\right|=2$, thus,
$$
\left|x_{1}\right|=\left|x_{2}\right|=1 \text {. }
$$

Then $\left|x_{1}\right|\left|x_{2}\right|=\left|x_{1} x_{2}\right|=\sin ^{2} \theta+1$
$$
\Rightarrow \sin ^{2} \theta=0 \Rightarrow \theta=0 \text {. }
$$

At this time, it satisfies $\Delta \leqslant 0$.
In summary, $\theta=0$.