4. As shown in Figure 3, given that $\triangle A B C$ is inscribed in $\odot O$, and $A B=A C$, diameter $A D$ intersects $B C$ at point $E, F$ is the midpoint of $O E$. If $B D / / C F, B C=2 \sqrt{5}$, then the length of line segment $C D$ is $\qquad$
4. $\sqrt{6}$.

Since $A B=A C, A D$ is the diameter, so $C E=B E=\sqrt{5}$.
Also, $B D / / C F$, which gives $\triangle B D E \cong \triangle C F E$. Therefore, $D E=E F$. Since $F$ is the midpoint of $O E$, then $O F=F E=E D$.
Let $O F=x$. Then $O A=O D=3 x, A E=5 x$. By the intersecting chords theorem, we have $C E \cdot B E=A E \cdot E D$, which is $(\sqrt{5})^{2}=x \cdot 5 x \Rightarrow x= \pm 1$.
Discarding the negative value, we get $C D=\sqrt{C E^{2}+D E^{2}}=\sqrt{6}$.