Until we reach that stage (if ever), technical people will still be needed in the loop – to check that the AI's work is correct, integrates properly with the rest of the system, and meets the requirements. And this leads to the main role of any engineer: figuring out the requirements. In other words, determining what exactly needs to be built.
People, in general, aren’t great at describing things in a precise, unambiguous way – and non-technical people even less so. I don't see this part of the equation being automated anytime soon.
As long as you enjoy figuring things out, solving technical problems, architecting software systems, and understanding software at a deep level, I think there will be work for you for the foreseeable future – no matter how "AI-assisted" it becomes.