Windows desktop app repeatedly restarts after corrupted local state; chat_processes.json can become all NUL bytes
Environment
- OS: Windows
- Codex Desktop package: OpenAI.Codex 26.616.9593.0
- App path:
C:\Program Files\WindowsApps\OpenAI.Codex_26.616.9593.0_x64__2p2nqsd0c76g0\app\Codex.exe
- Local Codex state path:
C:\Users\PC\.codex\process_manager\chat_processes.json
Problem
Codex Desktop restarted/crashed several times.
One confirmed failure mode was a corrupted local state file:
C:\Users\PC\.codex\process_manager\chat_processes.json
The file was 4600 bytes, and every byte was 0x00. Codex repeatedly logged JSON parse errors when trying to load it.
Relevant log message:
Failed to register chat process notification
Unexpected token '\^@', "\^@\^@..." is not valid JSON
at JSON.parse
After deleting chat_processes.json, Codex recreated it as valid JSON and the Unexpected token '\^@' error stopped.
Additional restart after deleting corrupted file
After the file was recreated successfully, Codex Desktop restarted again.
Observed timeline:
- 2026-06-23 16:19:49: Codex AppX process created, PID 29740
- 2026-06-23 16:22:32: last log line from that instance
- 2026-06-23 16:22:38: Windows AppModel logged Codex AppX container destroyed
- 2026-06-23 16:23:00: Codex AppX process recreated, PID 24884
The last Codex log line before the restart was:
warning [electron-sampler] Failed to collect child process snapshot
errorMessage="Unexpected end of input"
errorName=SyntaxError
There was no new codex.exe.*.dmp in:
C:\Users\PC\AppData\Local\CrashDumps
Windows Application logs did not show a normal Application Error for Codex at that time.
Expected behavior
Codex should not repeatedly restart or fail when a local state JSON file is corrupted.
Ideally:
- Local JSON state writes should be atomic.
- On startup, corrupted JSON state should be detected.
- The corrupted file should be quarantined or rebuilt automatically.
- The app should continue running instead of repeatedly logging parse errors or restarting.
Suspected root cause
The corrupted chat_processes.json appears to have been caused by an interrupted write.
The file's last write time was close to a Windows Kernel-Power 41 / BlueScreen event on the same machine. This suggests the machine may have crashed or restarted while Codex was writing the JSON state file.
Even if the original interruption was caused by the OS, Codex should handle corrupted local state defensively on the next launch.
Workaround
Deleting:
C:\Users\PC\.codex\process_manager\chat_processes.json
allowed Codex to regenerate the file as valid JSON and stopped the Unexpected token '\^@' log spam.
However, the app still restarted once afterward, with the final log line:
Failed to collect child process snapshot
Unexpected end of input
Logs / evidence available
I can provide the relevant Codex Desktop logs from:
C:\Users\PC\AppData\Local\Packages\OpenAI.Codex_2p2nqsd0c76g0\LocalCache\Local\Codex\Logs\2026\06\23
Key files include:
codex-desktop-01ee51bf-c616-45d7-a6a4-9a3159d79768-11080-t0-i1-061445-0.log
codex-desktop-37579744-5983-44e3-95d1-f563c735cc39-36280-t0-i1-080201-0.log
codex-desktop-3d207933-0368-4bf6-81f7-baa41015ffa7-29740-t0-i1-081950-0.log
codex-desktop-369818eb-461c-4cbc-8b41-fa2c6d6cb05c-24884-t0-i1-082300-0.logThis issue has 2 comments on GitHub. Read the full discussion on GitHub ↗