This is very closely related to this question. However in that question on top of the academic problems there are also major safety issues and the answers correctly focus on that. But this still leaves an interesting question unanswered: What should you do if you perceive your direct supervisor to be academically incompetent?
Suppose you start in a new lab as a masters or PhD student. The PI is great but very hands off. You are assigned a PhD student or a postdoc for your every day supervision. You get the impression that this person is failing academically. The linked question has a good list of clues. They have no plan for their own research, seem to have trouble understanding the surrounding literature or even the prerequisites, don't come up with new ideas to look into and maybe on top are technically inept and very bad at handling the lab equipment. Essentially you feel like you already are academically ahead of your supervisor and this person doesn't have anything to teach you.
What do you do? And in what time frame, having this impression after two weeks might be different than having it after 6 months but maybe waiting six months before doing anything is too much already.