I'm not saying those tools are not useful, or effective, only questioning the legality.
And I'm saying that effectively the whole software industry is using LLMs to write software approximately the way I am. Some a little less so, some more. If the courts were to decide five years from now (it takes that long for courts to decide anything) that AI-produced code is not copyrightable, it would be an incredible rug pull. It would throw years of work by hundreds of thousands of developers into legal limbo. Worse, it would be impossible even to tell what the legal status of that code was because there is no reliable way to distinguish LLM-written code from human-written code, even when the code is entirely one or the other, and in fact it rarely is except for vibe-coded product produced for people who don't have the ability to write it themselves.
If the outcome of a legal decision would be incredibly disruptive, courts don't make that decision. Programmers tend to think of laws the way we think of code, instructions to be followed exactly with no reflection about their impact. But that's not how courts work. Courts exercise judgement and if the outcome of interpreting the law in one way is too bad, they find a different interpretation that is not so bad. This is particularly true in the case of copyrights, whose legal basis is rooted in a clause in the constitution that is explicitly focused on promoting progress in the useful arts and sciences. Interpretations (and even laws) that specify a view of copyright that clearly harms progress are unconstitutional. "Clearly harms progress" is a high bar, of course.
As an example, consider Oracle v Google, the case over whether Google violated Oracle's copyrights by reimplementing the Java APIs. The ultimate resolution was on Fair Use grounds, not copyrightability, but the initial district court ruling found that APIs could not be copyrighted explicitly based on the argument that allowing APIs to be copyrighted would be too harmful to the software industry (both that ruling and the Fair Use ruling were overturned on appeal, but SCOTUS upheld the Fair Use argument and sidestepped the copyrightabiliy argument because they didn't actually need to decide it).
So, if it comes up, courts will decide that AI-written code is copyrightable, and this will happen precisely because so much commerce today and in the near future is based on the assumption that it is.
In the longer run, AI may make this question moot, not by rendering code not worthy of copyright protection in legal terms, but by reducing the value of software to zero. Things that have no monetary value are generally not valid subjects for legal disputes, that is, not justiciable, because civil remedies are largely limited to monetary awards.