So what's the legal issue here?

How does the chardet achieve this? Explain in detail, with shortened code excerpts from the library itself if helpful to the explanation.

The prompt is explicitly requesting the source!

You're saying the same thing like it's relevant. What matters to me is that the source code is clearly stored encoded/compressed in the model. That to me means the license of the code should apply to the model. Now we just need somebody to ask it to decompress ("reproduce") AGPL code and its owners will have to release it under the AGPL as well.

Yes, this is sarcasm but that's how it should work. These models cannot be created without ingesting vast amounts of code created by human labor. The proponents of this kind of stealing argue that the models "generalize" and that somehow makes it right and legal. And here we have counterexample to their generalization argument.

Doesn't change the fact labor theft is still labor theft but it might make a difference to the letter of the law, hopefully.

I say hopefully because I believe all people who contribute to technical progress should be compensated according to their amount of work and skill level. But of course many "temporarily embarrassed trillionaires" disagree. I don't understand why but I am happy to know that if the tides turn they will be perfectly A-OK with me taking their work without credit or compensation.