3. Given the quadratic function $y=x^{2}+(a+1) x+b$ (where $a$ and $b$ are constants). When $x=3$, $y=3$; for any real number $x$, $y \geqslant x$. Then the distance from the vertex of the parabola to the origin is $\qquad$ .
3. $\frac{1}{4} \sqrt{221}$.

Substitute $x=3, y=3$ into the quadratic function $y=x^{2}+(a+1) x$ $+b$ to get
$$
b=-3 a-9 .
$$

For any real number $x$, we have $y \geqslant x$, that is
$$
x^{2}+(a+1) x+b \geqslant x \text {. }
$$

Substitute $b=-3 a-9$ to get
$$
x^{2}+a x-3 a-9 \geqslant 0 \text {. }
$$

Then $\Delta=a^{2}-4(-3 a-9)=(a+6)^{2} \leqslant 0$.
So $a=-6$, and we get $b=9$.
Therefore, the quadratic function is $y=x^{2}-5 x+9$, with the vertex coordinates $P\left(\frac{5}{2}, \frac{11}{4}\right)$.
Thus, $O P=\sqrt{\left(\frac{5}{2}\right)^{2}+\left(\frac{11}{4}\right)^{2}}=\frac{1}{4} \sqrt{221}$.