(a) In any case in which a social worker, after investigation of an application for petition or other investigation he or she is authorized to make, determines that a child is within the jurisdiction of the juvenile court or will probably soon be within that jurisdiction, the social worker may, in lieu of filing a petition or subsequent to dismissal of a petition already filed, and with consent of the childs parent or guardian, undertake a program of supervision of the child. If a program of supervision is undertaken, the social worker shall attempt to ameliorate the situation which brings the child within, or creates the probability that the child will be within, the jurisdiction of Section 300 by providing or arranging to contract for all appropriate child welfare services pursuant to Sections 16506 and 16507.3, within the time periods specified in those sections. No further child welfare services shall be provided subsequent to these time limits. If the family has refused to cooperate with the services being provided, the social worker may file a petition with the juvenile court pursuant to Section 332. Nothing in this section shall be construed to prevent the social worker from filing a petition pursuant to Section 332 when otherwise authorized by law.
(b) The program of supervision of the child undertaken pursuant to this section may call for the child to obtain care and treatment for the misuse of, or addiction to, controlled substances from a county mental health service or other appropriate community agency.
(c) If the parent is a dependent of the juvenile court at the time that a social worker seeks to undertake a program of supervision pursuant to subdivision (a), including a voluntary family reunification program or a voluntary family maintenance program, and if counsel has been appointed for the parent pursuant to subdivision (c) of Section 317, the program of supervision shall not be undertaken until the parent has consulted with his or her counsel.