Repository navigation
Windows Codex Desktop: unhandled write EOF after IpcRouter EPIPE when browser-sidebar client closes #35985
Description
What version of Codex is running?
- Windows Store package:
OpenAI.Codex_26.721.4979.0_x64__2p2nqsd0c76g0 - Bundled CLI:
codex-cli 0.146.0-alpha.3.1
What platform is your computer?
Microsoft Windows NT 10.0.26200, x64.
What issue are you seeing?
Codex Desktop intermittently shows a native Electron error dialog during long-running sessions:
A JavaScript error occurred in the main process
Uncaught Exception:
Error: write EOF
at WriteWrap.onWriteComplete [as oncomplete]
(node:internal/stream_base_commons:87:19)
The matching Desktop log shows an IPC client lifecycle failure rather than a model, prompt, repository, or shell-command error. Immediately before the app-server stdio transport disconnects, the log records that the browser-sidebar target window is no longer live. The subsequent failure sequence is:
browser-sidebar routing: target window is no longer live
IpcRouter Socket error errorCode=EPIPE
... broadcastClientStatus ...
... unregisterClient ...
app_server_connection.state_changed ... next=disconnected ... transport=stdio
The EPIPE appears to escape the client-unregistration/broadcast path and becomes an uncaught Electron main-process write EOF exception. The dialog can recur during the same Desktop run and makes long unattended tasks unsafe because the app-server connection is lost and an interrupted turn is not reliably resumed.
Timeline and eliminated local causes
- The first matching
EPIPE/write EOFevent was recorded before any third-party Superpowers plugin was installed. - The same third-party plugin was later fully uninstalled; it is not needed to trigger the underlying failure.
- System Node.js was installed after the first captured event. Codex also uses its own bundled Node/runtime, so system Node did not introduce the original failure.
- A separately developed local MCP server was not registered with Codex and was created after the original event.
- The failure is cross-project and is observed in the Desktop IPC/app-server control path.
Windows AppX deployment history shows the Store app updated from 26.721.3996.0 to 26.721.4979.0 on July 24, 2026. The first captured failure on this machine occurred after that update.
Steps to reproduce
The failure is intermittent; there is not yet a deterministic minimal reproducer.
- Run Codex Desktop on Windows with the bundled Browser and/or Chrome integration enabled.
- Keep a local task active for an extended period.
- Allow the browser-sidebar window/client to close, become stale, or otherwise fail its liveness check while the app-server connection remains active.
- Observe
IpcRouter ... EPIPEduringbroadcastClientStatus/unregisterClient, followed by the Electronwrite EOFdialog and app-server stdio disconnection.
The dialog has occurred repeatedly during normal Desktop use without intentionally terminating the app-server.
Expected behavior
- Losing a browser-sidebar or other IPC client should deregister that client cleanly.
EPIPE,EOF, and already-closed-stream conditions during status broadcast/unregistration should be caught and treated as an expected client-disconnect race.- The exception must not escape to Electron's main process.
- The remaining Desktop/app-server session should stay connected, or reconnect and resume the interrupted turn automatically.
Temporary mitigation
The following local configuration is being tested as a containment workaround:
[plugins."browser@openai-bundled"]
enabled = false
[plugins."chrome@openai-bundled"]
enabled = false
[features]
browser_use = false
browser_use_external = false
browser_use_full_cdp_access = false
in_app_browser = false
[mcp_servers.node_repl]
enabled = falseThis is only a workaround because it removes supported Browser/Chrome functionality and does not harden the main-process IPC lifecycle itself.
Suggested areas to inspect
- Make
broadcastClientStatusresilient to sockets closing between liveness checking and write completion. - Make
unregisterClientidempotent and prevent it from broadcasting through a socket already being removed. - Attach/retain an error handler until all pending writes have settled.
- Treat Windows
EPIPE/EOFfrom a closed IPC client as a normal disconnect rather than an uncaught exception. - Add a regression test for a client/window disappearing while a status broadcast is in flight.
- Reconnect the app-server transport and resume any active turn when possible.
Related reports
- Windows Codex Desktop: Chrome plugin and Browser Use setup hang; plugin uninstall fails with os error 5 #21670 — Windows Chrome/Browser shared native-pipe instability with
IpcRouter Socket error: write EPIPE - Bug Report: Unable to Create New Conversations in Codex Desktop (thread/start Timeout) #30348 — app-server stdio disconnect and
write EPIPEafter a request lifecycle race - Browser Use IAB backend fails to connect on Windows #20846 — Windows Browser Use IAB bridge connection failures
- Windows Codex Desktop: Browser Use fails because import.meta.__codexNativePipe is undefined #19693 — Windows Browser native-pipe injection/bridge failure
This report is specifically for the uncaught Electron main-process write EOF crash path and the broadcastClientStatus → unregisterClient sequence.
Activity
github-actions commentedon Jul 29, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
speedaemonc4 commentedon Jul 29, 2026
Additional reproduction after a clean restart and automatic Store update:
OpenAI.Codex_26.721.11231.0_x64__2p2nqsd0c76g0, so it is not fixed in that newer build.not installed.[mcp_servers.node_repl]configuration withoutenabled = falseand launched twonode_repl.exechildren under the packaged app-server.BROWSER_USE_AVAILABLE_BACKENDSwas empty, while the Computer Use plugin andSKY_CUA_NATIVE_PIPEremained enabled.This indicates Browser/Chrome are not the only route capable of leaving the faulty IPC lifecycle active. A second isolation test now disables the Computer Use plugin and feature, removes its
turn-endednotifier, and explicitly disablesnode_repl. If the exception persists after that clean restart, the remaining cause is likely the general Desktop IPC router/app-server lifecycle rather than an optional browser backend.Mayokun26 commentedon Aug 3, 2026
I can reproduce the same uncaught Electron main-process stream failure on current macOS, with the Browser/Chrome native-pipe lifecycle involved.
Environment:
Visible dialog:
Matching Desktop log:
The same period also records repeated failures of the form:
Reproduction/behavior:
write EPIPEdialog begins recurring every few minutes.An additional diagnostic detail: after the first pair of
browser-use-native-pipe-serverEPIPE warnings, the native dialogs could continue recurring without a corresponding new EPIPE line appearing in the Desktop log.Expected behavior:
This appears to be the macOS
write EPIPEvariant of this issue, with route-binding symptoms related to #20678. Browser functionality is operational and important to the running tasks, so disabling Browser/Chrome is not a viable workaround.neitblackstar-droid commentedon Sep 23, 2026
Draft update for openai/codex issue #35985
The same
IpcRouterclosed-socket failure is still present in the current Codex Desktop build on Windows.Environment
OpenAI.Codex_26.915.4065.0_x64__2p2nqsd0c76g0(Status: Ok).codex@26.915.31945.Observed behavior
On 2026-09-23 at 08:24 local time (UTC+7), Codex displayed an Electron main-process dialog with
Uncaught Exception: Error: write EPIPE. The stack begins atafterWriteDispatchedandwriteGenericin Node streams. The previous app process logged this sequence during shutdown (timestamps UTC):This is recurrent in the local logs: 13 prior main-process sessions created over the last seven days each logged four
IpcRouterEPIPE events within the final 8–10 lines of their log. In all 13 sessions,Stopping app-server transportandupdate_resume_state_savedappear in the five lines immediately before the first EPIPE. The current process started at 08:24:32 and has no EPIPE event while running.The log sequence and stack support a shutdown/IPC client unregister race. They do not prove which specific client socket first closed. The visible modal was captured once; the log failure recurs more often than a modal has been confirmed.
Expected behavior
When a client socket has closed during app-server shutdown or update, the router should unregister the client and handle
EPIPEwithout an uncaught main-process exception or blocking dialog. The app should complete its restart and preserve recoverable work.No raw logs or screenshot are attached because they contain local paths and other personal metadata. Sanitized excerpts can be supplied if maintainers need more detail.
neitblackstar-droid commentedon Sep 23, 2026
Follow-up from the same Windows machine (2026-09-23): clicking the in-app Update button on Store package
26.915.4065.0reproduced theUncaught Exception: Error: write EPIPEdialog at about 08:45 local time (UTC+7). The old process loggedupdate_resume_state_saved, thenStopping app-server transport, followed about 50 ms later by four[IpcRouter] ... errorCode=EPIPEentries withbroadcastClientStatus -> unregisterClientin the stack. At the same time, Windows AppX event 404 reported that registration of stagedOpenAI.Codex_26.917.6896.0failed with0x80070005becauseOpenAI.Codex_...!Appwas still running (event 638: packages not updated because affected apps are still running). The app restarted on26.915.4065.0, so the update button had not completed the update.After fully closing Codex, I registered the already staged, validly signed OpenAI package. Windows AppX then recorded a successful Register operation at 09:02:23;
Get-AppxPackageand the running executable both confirm26.917.6896.0, statusOk. The new session has no EPIPE log entries so far, but that is not proof this build fixes the IPC/shutdown race on a future update. This adds a reproducible update-time trigger and a separate app-in-use registration failure to the existing report. No raw logs, paths, account IDs, or screenshots are attached.neitblackstar-droid commentedon Sep 24, 2026
Follow-up from the same Windows 10 22H2 machine (2026-09-24): the update-time
write EPIPEdialog recurred on Store package26.917.8451.0when clicking the in-app Update button. At 08:14:30 UTC, Desktop loggedupdate_resume_state_saved threadCount=0, thenStopping app-server transport/next=disconnected; four[IpcRouter] Socket error errorCode=EPIPEwarnings followed at 08:14:31 UTC. Windows AppX events 401/404 at 15:14:31 local (UTC+7) show registration of stagedOpenAI.Codex_26.917.9434.0failed with0x80070005: "Unable to install because the following apps need to be closed OpenAI.Codex_...!App." The app relaunched from26.917.8451.0; its updater reportsrestart_required. Two earlier sessions today on26.917.6896.0each logged four shutdown-time EPIPE warnings as well. This shows the IPC/shutdown failure persists across these builds and the updater is attempting registration while the app is still open. No raw logs, account identifiers, local paths, or screenshot are attached.neitblackstar-droid commentedon Sep 24, 2026
Further evidence on the same Windows 10 22H2 host (2026-09-24): I installed the already staged, validly signed OpenAI.Codex_26.917.9434.0 package after stopping the app. Windows AppX event 400 at 15:30:50 UTC+7 and Get-AppxPackage confirm successful registration (Status: Ok); the running desktop app uses that package (build 10954).
The IPC error still appeared in the 26.917.9434.0 desktop log at 08:46:22 UTC during a later app process exit, without clicking Update in that session. Immediately before it, the log records repeated browser-sidebar IAB_LIFECYCLE "route window is not live" messages and removal of the browser session window. It then records two [IpcRouter] Socket error errorCode=EPIPE warnings with broadcastClientStatus -> unregisterClient in the stack, followed by app-server stdio transport stopping and next=disconnected. I did not confirm a visible Electron modal for this particular occurrence; this establishes that the IPC error path persists, not that every warning displays a modal.
A supported managed features.in_app_updates = false policy is now active only as containment for the Update-button trigger; the app's update check reports "In-app updates are disabled by policy." This does not fix the underlying IPC lifecycle race. No raw logs, local paths, account identifiers, or screenshots are attached.