codex - 💡(How to fix) Fix Codex Desktop on Windows crashes with RangeError: Invalid string length when opening a specific task card before the task starts

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Codex Desktop crashes with a JavaScript main-process error when opening a specific task card. The task does not need Error dialog: A JavaScript error occurred in the main process Uncaught Exception: 2026-05-20T09:23:21.207Z error [electron-message-handler] Item not found in turn state 5. While Codex Desktop is displaying/loading the task content, the JavaScript main-process error dialog appears.

RAW_BUFFERClick to expand / collapse

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:

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?

1. Open Codex Desktop on Windows.
2. Open the task list.
3. Click a specific existing task card.
4. Do not start or resume the task.
5. 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_

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING

codex - 💡(How to fix) Fix Codex Desktop on Windows crashes with RangeError: Invalid string length when opening a specific task card before the task starts