It's different in the same way that mass surveillance by law enforcement is somehow legal. The law simply hasn't caught up with reality. In mass surveillance, the premise is that if the government could have put a cop there, they can put a camera there. Yet this is totally different in scale, expense, and ease of use -- making it not the same thing at all. These three factors put a natural limit on the scale of surveillance, limiting the reach of the government to high profile crimes. Cheap and pervasive cameras throw out that balance, and with it, the social contract.
In a FOSS project, the code is out in the wild (unlike most commercial software) and it would be incumbent on the LLM to prove it wasn't trained on that software, or derivative software, to be clean. Or arguably any open-source software.
Another way to evaluate this would be to ask if the LLM can do the same thing with closed source software. If it can, I would call that a legal work-alike, for any code base. I'll be asking for my legal open-source copy of Windows, Adobe, etc. If it can't, it's somehow using the copyrighted open-source code.