Codex Desktop on Windows crashes with RangeError: Invalid string length when opening a specific task card before the task starts
What version of the Codex App are you using (From “About Codex” dialog)?
26.513.4821.0
What subscription do you have?
chatgpt plus
What platform is your computer?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
Codex Desktop crashes with a JavaScript main-process error when opening a specific task card. The task does not need
to start running. The crash happens while the app is rendering/loading the task content.
Affected conversation ID:
019e44a4-96d3-7e42-afd7-94aab09a3bb4
Error dialog:
```text
A JavaScript error occurred in the main process
Uncaught Exception:
RangeError: Invalid string length
at fd.write (...)
at Socket.onStdoutData (...)
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)
Relevant local log entries with PII redacted:
2026-05-20T09:23:21.207Z error [electron-message-handler] Item not found in turn state
itemId=call_e8g1oRJmjPYq9zz3NjY9ltjn
2026-05-20T09:23:29.786Z info [electron-message-handler] turn_completed_with_incomplete_plan completedPlanStepCount=4
conversationId=019e44a4-96d3-7e42-afd7-94aab09a3bb4 planStepCount=5 turnId=019e44a7-2972-76d2-bc35-27851444a31e
2026-05-20T09:35:25.851Z info [AppServerConnection] response_routed broadcastFallback=false conversationId=019e44a4-
96d3-7e42-afd7-94aab09a3bb4 durationMs=1 errorCode=null hadInternalHandler=false hadPending=true method=turn/start
This appears to be a desktop UI/state handling issue rather than a task execution failure. The crash occurs while
opening/rendering the task card.
What steps can reproduce the bug?
- Open Codex Desktop on Windows.
- Open the task list.
- Click a specific existing task card.
- Do not start or resume the task.
- While Codex Desktop is displaying/loading the task content, the JavaScript main-process error dialog appears.
What is the expected behavior?
_No response_
Additional information
_No response_
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Adding another reproduction variant for this same main-process crash signature.
Environment
OpenAI.Codex_26.608.1337.0_x64__2p2nqsd0c76g0149.0.7827.5410.0.19045x64Crash signature
Dialog shows:
Observed trigger
This was not tied to executing a user command in the terminal. The crash was correlated with Codex Desktop review/status activity on a local Git repo with a very large generated asset change set.
Local Git state at the time:
git status --short --untracked-files=allreturned849changed/untracked paths846paths were under one generated asset/content tree394 .txt,339 .png,70 .json,26 .md,17 .py,3 .pdf.gitignoreRelevant sanitized Codex Desktop log pattern:
The app logs repeatedly showed
review_model/branch-diff-statsGit calls with ~850 file arguments immediately before/around the crash. Some Codex desktop logs rotated around ~10 MB while recording these commands, because the serialized command/log payload included hundreds of file paths.Why this may be a distinct reproduction path
Existing reports discuss oversized session rollouts / inline base64 image data as one way to overflow the main-process stdout string aggregation. This case appears to hit the same
Socket.onStdoutData/ string-length failure mode through the Desktop review subsystem generating or logging very large Git command payloads for a repo with hundreds of generated assets.Expected behavior
Codex Desktop should cap/chunk/summarize review-model Git payloads and log records for large worktrees, and should surface a recoverable error if a review summary cannot be generated. It should not crash the Electron main process.
Workaround confirmed
Reducing the Git change set or adding an ignore/tracking policy for generated assets avoids the review flow trying to process hundreds of paths at once.