4. Let $x \in \mathbf{R}$. Then the maximum value of $y=\frac{\sin x}{2-\cos x}$ is
4. $\frac{\sqrt{3}}{3}$.

As shown in Figure 3, let $A(\cos \theta, \sin \theta), B(2,0)$.
Then $k_{A B}=\frac{-\sin \theta}{2-\cos \theta}$.
Thus, $-k \in\left[-\frac{\sqrt{3}}{3}, \frac{\sqrt{3}}{3}\right]$.
Therefore, $k_{\max }=\frac{\sqrt{3}}{3}$.