At a time like this, don't put all your eggs in one basket. So maybe come up with a plan to get more baskets.
What would that look like? Well, I've seen the statement that you can become a licensed phlebotomist (one who draws blood) for $500. That gives you an option that is not "write code until I get laid off". (Of course, in a true AI takeover, we're going to have blood-drawing robots eventually, so it's not a permanent fix.)
More generally, even if software stays around forever, you may not be doing the same kind of software for your whole career. (I have done both internet security software and embedded systems.) You almost certainly won't be at the same company for your whole career. Keep learning new things, and keep your eyes open for new opportunities. Right now is more scary than it often is, but we have always needed to keep our eyes open for what we'll do next.
What would that look like? Well, I've seen the statement that you can become a licensed phlebotomist (one who draws blood) for $500. That gives you an option that is not "write code until I get laid off". (Of course, in a true AI takeover, we're going to have blood-drawing robots eventually, so it's not a permanent fix.)
More generally, even if software stays around forever, you may not be doing the same kind of software for your whole career. (I have done both internet security software and embedded systems.) You almost certainly won't be at the same company for your whole career. Keep learning new things, and keep your eyes open for new opportunities. Right now is more scary than it often is, but we have always needed to keep our eyes open for what we'll do next.