4. If the equation $s x^{2}+t x+s-1=0$ with respect to $x$ has real roots for any real number $t$, then the range of the real number $s$ is ( ).
(A) $s<0$
(B) $s<0$ or $s \geqslant 1$
(C) $0 \leqslant s<1$
(D) $0<s \leqslant 1$
4. D.

If $s=0$, the equation becomes $t x-1=0$. When $t=0$, it clearly has no solution, which contradicts the problem statement.
Therefore, $s \neq 0$, and the equation must be a quadratic equation.
Consider the discriminant
$$
\Delta=t^{2}-4 s(s-1) \geqslant 0 \Rightarrow s(s-1) \leqslant \frac{t^{2}}{4} \text {. }
$$

Combining the arbitrariness of $t$, it is only necessary to ensure that $s(s-1) \leqslant 0$. Thus, $0 \leqslant s \leqslant 1$.
Noting that $s \neq 0$, we have $0<s \leqslant 1$.