Cursor+Claude 3.7 is dropping long responses prematurely?

My first task for Claude 3.7 was to generate some code, it did so and while applying the changes to a file, it suddenly stopped and the only indication is “(Stopped)” in the chat. No error messages or anything. I tried this several times all with the same result. The changes were not applied to the file.

I finally asked it to output the code directly in the chat window and it did and it revealed there is an issue somewhere because it output only a part of the code and then displayed (Stopped) in the chat.

The total bytes it provided before stopping in all cases was 21.5kb

The code was for a single file.
It seems to work fine if providing small pieces of code less than 21.5kb