4. If the cotangents of the three interior angles $A, B, C$ of triangle $\triangle A B C$, $\cot A, \cot B, \cot C$, form an arithmetic sequence, then the maximum value of angle $B$ is $\frac{\pi}{3}$.
Let $x=\cot A, y=\cot B, z=\cot C$, which form an arithmetic sequence, i.e., $2 y=x+z$. Since the sum of the three interior angles equals $\pi$, at most one of $x, y, z$ is less than or equal to zero, which implies $y \geqslant 0$. On the other hand, $A+B=\pi-C$ implies
$$
\frac{x y-1}{x+y}=-z,
$$

which means $x y+y z+z x=1$. Eliminating $z$, we get $x^{2}-2 x y+\left(1-2 y^{2}\right)=0$. This quadratic equation in $x$ has real roots, so the discriminant $\Delta=12 y^{2}-4 \geqslant 0$. This indicates $\cot B=y \geqslant \frac{\sqrt{3}}{3}$, i.e., $B \leqslant \frac{\pi}{3}$. When $A=B=C=\frac{\pi}{3}$, angle $B$ reaches its maximum value.