Codex (macOS) main process crashes repeatedly: RangeError: Invalid string length in WF.write / Socket.onStdoutData
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.
Is 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.
The error dialog reads:
A JavaScript error occurred in the main process
Uncaught Exception:
RangeError: Invalid string length
at WF.write (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/src-uFOVO82H.js:364:21)
at Socket.onStdoutData (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/src-uFOVO82H.js:364:4174)
at Socket.emit (node:events:508:28)
at addChunk (node:internal/streams/readable:563:12)
at readableAddChunkPushByteMode (node:internal/streams/readable:514:3)
at Readable.push (node:internal/streams/readable:394:5)
at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
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.
The environment is MacOS silicon, with the desktop app – I always update it - it’s happened on many version updates in the last month)
Discussion in the ATmosphere