{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreigc6lnneygs6rhw7l32amfjbisxde4fnu3ble3idfcxe2nzrpcgda",
"uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3moowzsb7sm72"
},
"path": "/t/codex-macos-main-process-crashes-repeatedly-rangeerror-invalid-string-length-in-wf-write-socket-onstdoutdata/1384175#post_1",
"publishedAt": "2026-06-20T03:08:47.000Z",
"site": "https://community.openai.com",
"textContent": "I’m hitting a hard crash in the Codex desktop app on macOS where certain chat windows throw a JavaScript error in the main process. Once it starts, the dialog reappears every time I click OK — holding Enter or repeatedly dismissing it does nothing, and the app becomes unusable until I force quit. I cannot open up that window anymore, I have to archive it, and sort through my image renders afterwards and rename or sort things.\n\nIs this a problem anyone else is having and are there any known fixes? I searched this forum but wasn’t sure that I was finding anything.\n\nThe error dialog reads:\n\n\n A JavaScript error occurred in the main process\n\n Uncaught Exception:\n RangeError: Invalid string length\n at WF.write (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/src-uFOVO82H.js:364:21)\n at Socket.onStdoutData (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/src-uFOVO82H.js:364:4174)\n at Socket.emit (node:events:508:28)\n at addChunk (node:internal/streams/readable:563:12)\n at readableAddChunkPushByteMode (node:internal/streams/readable:514:3)\n at Readable.push (node:internal/streams/readable:394:5)\n at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)\n\n\n\n`RangeError: Invalid string length` is V8’s maximum-string-length limit, so it looks like `onStdoutData` is accumulating subprocess stdout into a single string that grows past the cap and crashes the main process. Because the affected window keeps trying to process that same oversized buffer, the crash loops on every reopen/click.\n\n**The environment is MacOS silicon, with the desktop app –** I always update it - it’s happened on many version updates in the last month)",
"title": "Codex (macOS) main process crashes repeatedly: RangeError: Invalid string length in WF.write / Socket.onStdoutData"
}