When I read the title and the first sentence I immediately thought of partial writes, one of those things that a lot of people seem to ignore until things stop working, often intermittently. I don't work with Node.js, but I've had to fix plenty of network code that had the same bug of not handling partial writes correctly.
I thought gpt-4o and o1-preview would be able to do this pretty easily, but surprisingly not.
You're surprised that AI doesn't work? I'm not.