— Appeal by defendant from a judgment of the County Court, Rockland County, rendered November 26, 1974, convicting him of rape in the second degree, upon his plea of guilty, and imposing sentence. Judgment affirmed. There is no statute which requires a sanity hearing in every instance in which it is claimed that the defendant has a mental problem or a history of psychiatric treatment (People v Armlin, 43 AD2d 782). No sanity hearing was requested by defendant; it appears that he consented, after a thorough consideration of the consequences, to the confirmation of psychiatric reports which found him capable of standing trial. We are unable to say, on the basis of the record, that the County Court abused its discretion in failing to order a sanity hearing sua sponte. Nor was a Huntley hearing required since “The issue as to whether the confession was illegally obtained is waived by the guilty plea” where a defendant has knowingly and voluntarily pleaded guilty (People v Nicholson, 11 NY2d 1067, 1068). Rabin, Acting P. J., Martuscello, Cohalan, Christ and Shapiro, JJ., concur.