This reminds me of my experience using computer-assisted mathematical proof systems, where the computer's proof search pointed me at the Cantor–Schröder–Bernstein theorem, giving me a great deal of insight into the problem I was trying to solve.
That system, of course, doesn't rely on generative AI at all: all contributions to the system are appropriately attributed, etc. I wonder if a similar system could be designed for software?