Repository navigation
Open
Labels
appIssues related to the Codex desktop appbugSomething isn't workingperformancewindows-osIssues related to Codex on Windows systems
Description
Environment
- Codex Desktop Version:
OpenAI.Codex 26.1023.6123.0/26.1023.6621.0(Windows Store MSIX) - Hardware: Surface Laptop 7 (Snapdragon X Elite
X1E8010012-core, Qualcomm Adreno X1-85 GPU, 64 GB RAM) - OS: Windows 11 ARM64 (
26200)
Summary
While investigating severe UI freezes (5–11s main-thread stalls when switching threads, laggy scrolling, high background CPU/disk I/O, and multi-GB memory growth) on Windows 11 ARM64, I profiled the Electron renderer/main processes, codex.exe app-server, SQLite databases, and bundled runtime scripts.
I identified 6 distinct root causes and verified surgical fixes locally across 26.1023.6123.0 and 26.1023.6621.0. Since docs/contributing.md notes that external PRs are not accepted and asks for root-cause analyses in issues, here are the exact root causes and fixes for the Codex Desktop team:
1. @oai/artifact-tool host-daemon.mjs crashes every 5 seconds on Windows due to Unix 0o077n permission check (Related: #42669, #55194)
- Root Cause:
dependencies/node/node_modules/@oai/artifact-tool/dist/artifact-session/host-daemon.mjsvalidates the runtime directory and socket file permissions using(stat.mode & 0o077n) !== 0n(expecting Unix0700/0600). On Windows NTFS,fs.stat()always returns0o666(rw-rw-rw-) for group/other bits. As a result,host-daemon.mjsthrows"Artifact runtime directory has insecure permissions", deletes its state, exits, and is respawned every ~5 seconds indefinitely. Furthermore, it attempts to bind a filesystem.sockpath instead of a Windows Named Pipe. - Verified Fix:
- Bypass the
(n.mode & 0o077n) !== 0ncheck whenprocess.platform === "win32". - On
win32, bindnet.createServerto a Windows Named Pipe (\\.\pipe\codex-artifact-daemon-<hash>) instead of a filesystem.sockfile, while writing the pipe endpoint metadata so the client can connect cleanly.
- Bypass the
2. Forced WARP CPU Software Rasterization (--disable-gpu-compositing --use-angle=d3d11-warp-webgl) cripples Windows ARM64 / Adreno X1-85 (Related: #20413, #13749)
- Root Cause: Launching
ChatGPT.exeon Windows ARM64 passes--disable-gpu-compositingand--use-angle=d3d11-warp-webgl, forcing Microsoft WARP CPU software rendering across 4 CPU threads. On high-DPI multi-monitor setups, scrolling long code blocks or moving the window across monitors causes severe frame drops.- Note: The 120Hz sidebar ghosting reported in Windows: sidebar ghost trails/stale repaints at 120Hz; disabling GPU compositor fixes it #20413 is caused by Windows DWM acrylic/transparency compositing, not hardware GPU rasterization itself.
- Verified Fix:
- Enable hardware acceleration (
"hardware_acceleration_mode": { "enabled": true }inLocal State) and disable DWM window transparency (opaqueWindows = trueinconfig.toml). This completely eliminates 120Hz sidebar ghosting while restoring full Direct3D11 hardware compositing on Adreno X1-85.
- Enable hardware acceleration (
3. [primary-runtime-installer] repeatedly unpacks 1.2 GB (358 MB archive) due to Windows EPERM directory rename & stale runtime.json (Related: #40182)
- Root Cause: When unpacking
codex-primary-runtimeinto%USERPROFILE%\.cache\codex-runtimes\codex-primary-runtime\.staging-*, if any child process (node.exe/ helper) holds an open handle in the target directory on Windows, the final atomic rename fails withEPERM.runtime.jsonremains stuck on the oldbundleVersion(e.g.,26.909.12148), causing the installer to re-unpack 1.2 GB on every launch/hourly check. - Verified Fix:
- Before final activation rename on Windows, terminate lingering processes holding handles inside
codex-primary-runtime, use retry with exponential backoff onEPERM/EACCES, clean up orphaned.staging-*folders, and ensureruntime.jsonbundleVersionstays synchronized once the unpacked payload is valid.
- Before final activation rename on Windows, terminate lingering processes holding handles inside
4. thread_history_1.sqlite grows to 5.3+ GB, pre-hydrates all pinned threads on startup, and re-parses multi-hundred-MB .jsonl from byte 0 if thread_history_projection_state is missing (Related: #33996, #44888)
- Root Cause:
thread_history_1.sqliteaccumulates unbounded intermediatecommentaryitems and tool outputs across long sessions (reaching5.32 GBlocally).- On startup, the app pre-loads all
pinned-thread-ids. - If
thread_history_projection_state(next_rollout_byte_offset) is missing or out of sync with the.jsonlrollout file size,codex.exe app-serverre-projects the entire.jsonlfile from byte0on the main RPC path, freezing the UI for 5–11 seconds.
- Verified Fix:
- Cap projected/hydrated turns per thread (e.g., latest 8 turns in hot projection cache), prune intermediate
commentaryblocks from older turns, and always preserve/advancethread_history_projection_state.next_rollout_byte_offsetto the.jsonlEOF so historical rollouts are never re-parsed from byte0.
- Cap projected/hydrated turns per thread (e.g., latest 8 turns in hot projection cache), prune intermediate
5. Bundled [plugins."visualize@openai-bundled"] <webview> triggers ResizeObserver loop completed with undelivered notifications during streaming (Related: #33996, #33782, #57062)
- Root Cause: When
visualize@openai-bundledis enabled, embedded<webview>containers inside streaming turns trigger hundreds ofResizeObserver loop completed with undelivered notificationslayout thrashing events per second. - Verified Fix: Disabling
visualize@openai-bundledby default (or deferring<webview>height measurement until streaming settles) eliminates theResizeObserverfreeze.
6. Orphaned MCP stdio & shell child processes on Windows (360+ leaked processes / 9.4 GB RAM) (Related: #26984, #33776)
- Root Cause: On Windows, terminating a parent stdio session or timing out a tool call does not automatically kill grandchild processes (
node.exe,python.exe,powershell.exe,conhost.exe) unless bound to a Win32 Job Object. - Verified Fix: Assign spawned MCP stdio servers and tool subprocesses on
cfg(windows)to a Win32 Job Object configured withJOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE.
Metadata
Metadata
Assignees
Labels
appIssues related to the Codex desktop appbugSomething isn't workingperformancewindows-osIssues related to Codex on Windows systems
Activity
github-actions commentedon Oct 29, 2026
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action