I tried the agent mode with sonnet 3.7 (not the thinking one). When it started trying to create a file, it kept getting a "Failed to connect to API: 400 Bad Request" error. After a few attempts to create files, it "touch"ed a file and tried to edit this, which also failed. It checked permissions with "ls -la", then it tried to "cat" the code into it but failed because of syntax errors (to do with quoting). Then it tried nano(?!?!) and failed, and then it started "echo"ing the code into the file chunk by chunk, which started working. After 4 chunks it got an error and then it made the following chunks smaller. It took it a dozen "echo"s or so.
While the initial 400 error is a bummer, I am actually surprised and admire its persistence in trying to create the file and in the end finding a way to do so. It forgot to define a couple of stuff in the code, which was trivial to fix, after that the code was working.