{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreickyva6ymrq7p2a3wqjqo5qo5u5xzc5jw72kzwupdhufq2q6gtgwe",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mopei46h3eo2"
  },
  "path": "/t/codex-macos-main-process-crashes-repeatedly-rangeerror-invalid-string-length-in-wf-write-socket-onstdoutdata/1384175#post_2",
  "publishedAt": "2026-06-20T07:00:03.000Z",
  "site": "https://community.openai.com",
  "tags": [
    "OpenAI Codex",
    "github.com/openai/codex",
    "Reappearing crash loop - Codex UI became completely unusable",
    "devinbost"
  ],
  "textContent": "You are welcome to discuss Codex issues on the forum, however the official place to report and track them is the GitHub issue tracker for OpenAI Codex.\n\nI had ChatGPT look for the closest related issue and it identified:\n\ngithub.com/openai/codex\n\n####  Reappearing crash loop - Codex UI became completely unusable\n\nopened 03:19PM - 26 May 26 UTC\n\n\n\n          devinbost\n        \n\nbug  app  session\n\n### What version of the Codex App are you using (From “About Codex” dialog)? I …can't even open this due to this bug, but it was latest version as of May 25th, 2026 ### What subscription do you have? Pro ### What platform is your computer? Darwin 25.4.0 arm64 arm ### What issue are you seeing? Crash loop showed this: ``` Uncaught Exception: RangeError: Invalid string length at Ed.write (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/workspace-root-drop-handler-Bom6Z7sW.js:292:21) at Socket.onStdoutData (/Applications/Codex.app/Contents/Resources/app.asar/.vite/build/workspace-root-drop-handler-Bom6Z7sW.js:292:4146) at Socket.emit (node:events:509: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) ``` It appeared again upon startup. Immediately after clicking OK, it appears again, and the app has become unusable. Restarting the app causes it to appear again. There is no obvious way to get it to disappear. I can't click anything in the Codex UI other than OK, but it reappears immediately. <img width=\"1046\" height=\"883\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/f0386f30-4978-4dc8-bc7c-e61664b568c5\" /> Codex will also only shut down via Force Quit now. I also tried to reset session state via the following, but it didn't solve the problem: ``` osascript -e 'quit app \"Codex\"' 2>/dev/null || true pkill -f '/Applications/Codex.app' 2>/dev/null || true REC=\"$HOME/.codex/recovery-$(date +%Y%m%d-%H%M%S)\" mkdir -p \"$REC\" mv \"$HOME/Library/Application Support/Codex/Session Storage\" \"$REC/\" 2>/dev/null || true mv \"$HOME/Library/Application Support/Codex/Local Storage\" \"$REC/\" 2>/dev/null || true mv \"$HOME/.codex/.codex-global-state.json\" \"$REC/\" 2>/dev/null || true open -a Codex ``` I was able to clear it by running this script: ``` osascript -e 'quit app \"Codex\"' 2>/dev/null || true pkill -f '/Applications/Codex.app' 2>/dev/null || true REC=\"$HOME/.codex/recovery-$(date +%Y%m%d-%H%M%S)\" mkdir -p \"$REC/bad-sessions\" find \"$HOME/.codex/sessions\" -type f -name '*.jsonl' -mtime -7 -size +25M -exec ls -lh {} + BAD=\"$(find \"$HOME/.codex/sessions\" -type f -name '*.jsonl' -mtime -7 -size +25M -print | xargs ls -t 2>/dev/null | head -1)\" echo \"Quarantining: $BAD\" if [ -n \"$BAD\" ]; then base=\"$(basename \"$BAD\" .jsonl)\" THREAD_ID=\"$(printf '%s\\n' \"$base\" | awk -F- '{print $(NF-4)\"-\"$(NF-3)\"-\"$(NF-2)\"-\"$(NF-1)\"-\"$NF}')\" mv \"$BAD\" \"$REC/bad-sessions/\" sqlite3 \"$HOME/.codex/state_5.sqlite\" \"update threads set archived=1, archived_at=strftime('%s','now') where id='$THREAD_ID';\" fi open -a Codex ``` ### What steps can reproduce the bug? I stopped a thread. It's otherwise not known what caused this. ### What is the expected behavior? Codex should be usable ... or, it should at least be possible to dismiss the error. ### Additional information _No response_\n\nIf that issue matches your problem, consider adding a  reaction on the GitHub issue page itself, not just on the forum topic, as reactions on GitHub help the developers gauge impact and prioritize work.\n\nIf it is not the same issue, try searching the existing GitHub issues for a closer match. If you cannot find one, then open a new issue with as much detail as possible.",
  "title": "Codex (macOS) main process crashes repeatedly: RangeError: Invalid string length in WF.write / Socket.onStdoutData"
}