4. If the equation
$$
n \sin x+(n+1) \cos x=n+2
$$

has two distinct real roots in $0<x<\pi$, then the minimum value of the positive integer $n$ is $\qquad$.
4.4.

From the given, we have $\frac{1}{n}=-1-\frac{-1-\sin x}{2-\cos x}$.
And $\frac{-1-\sin x}{2-\cos x}$ represents the slope $k$ of the line connecting a moving point $P(\cos x, \sin x)$ on the upper half of the unit circle (excluding endpoints) and a fixed point $Q(2,-1)$.

To satisfy the problem, the line $PQ$ must intersect the upper half of the unit circle (excluding endpoints) at two distinct points, in which case, $k \in\left(-\frac{4}{3},-1\right)$.
Thus, $\frac{1}{n} \in\left(0, \frac{1}{3}\right)$, which gives $n>3$.
Therefore, the smallest positive integer value of $n$ is 4.