AI-generated code still requires software engineers to build, test, debug, deploy, secure, monitor, be on-call, support, handle incidents, and so on. That's very expensive. It is much cheaper to pay a small monthly fee to a SaaS company.
1. ai being able to code well seems like it would also get pretty close/good at doing basically everything else you described. If coding is a game of reasoning, if you can solve that, you have effectively solved reasoning and you can likely map it to most other problems provided you have a sufficiently good harness and toolcalling setup. 2. Lets assume AI won't replace everyone as point (1) assumes - and it just replaces _most_ people. Under this assumption, we will likely see large swathes of layoffs. Many SaaS companies have a pay per seat model. Less people employed at companies = less seats being paid for = less SaaS revenue.
So not only is there a threat of companies just vibe coding various SaaS-es in house, but there is also a threat that the TAM of many SaaS products (which is typically proportional to the # of employees there are) will actually _shrink_ in size.
I think the main class of SaaS company that will remain in the medium term are the ones in legally touchy or compliance heavy industries - think healthcare, finance and security (workday for example). But even Workday will be affected by point (2) from above. Overall, I think the mid-long term outlook for SaaS, especially "SaaS", is not great.