Cal. Penal Code § 1368
(c) Except as provided in Section 1368.1, when an inquiry into the present mental competence of the defendant has been commenced by the court all proceedings in the criminal prosecution shall be suspended until the question of the present mental competence of the defendant has been determined.
If a jury has been impaneled and sworn to try the defendant, the jury shall be discharged only if it appears to the court that undue hardship to the jurors would result if the jury is retained on call.
If the defendant is declared mentally incompetent, the jury shall be discharged.