“Unable to generate edits” on large files (>1000 lines) with even slightly complex modifications

After spending a lot of time debugging this, I discovered a very frustrating and reproducible bug:

When a single file contains many lines of code (around 1000+ lines), and you ask ChatGPT to make a modification that’s even slightly complex (not a refactor, just moderate consistency changes), it almost always returns:

“Unable to generate edits”

No matter how many times you retry, it fails — and ChatGPT just continues as if nothing happened, leaving you stuck.