Repository navigation
Description
What version of the Codex App are you using (From “About Codex” dialog)?
26.924.2738.0
What subscription do you have?
ChatGPT Plus
What platform is your computer?
Windows 11 Version 24H2 (Build 26100.9457)
What issue are you seeing?
Since updating to Windows desktop version 26.924.2738.0, the ChatGPT/Codex
desktop app fails during startup when using the Windows-native Codex runtime.
The visible error is:
failed to initialize sqlite state runtime under C:\Users<user>.codex
failed to initialize state runtime at C:\Users<user>.codex
I investigated this with Process Monitor and reproducible process tests.
The failure appears to be a race during app-server startup/restart rather than
corruption of my .codex data.
Observed sequence:
- ChatGPT starts codex.exe.
- Approximately 1 second later, the desktop app terminates that codex.exe
process and starts a replacement process. - On this machine, Cisco Secure Endpoint substantially delays teardown of the
terminated codex.exe process. The terminated process remains present for
approximately 15-16 seconds. - During teardown, the original process still has memories_1.sqlite-shm
memory-mapped. - The replacement codex.exe starts approximately 2-3 seconds after the first
process is terminated. - SQLite attempts to initialise/reset its shared-memory state while the old
mapping still exists. - Windows returns USER MAPPED FILE and Codex exits with the
"failed to initialize sqlite state runtime" error.
This is reproducible independently of my existing Codex data.
A completely empty Codex home works on its first launch because the state
databases do not yet exist. Once the databases have been created, the same
fresh Codex home can reproduce the failure on a subsequent launch.
I can also reproduce the exact failure outside the desktop startup sequence by:
- starting codex.exe;
- terminating it approximately 1 second later;
- starting another instance approximately 2.6 seconds later.
If I instead wait approximately 20 seconds for the first process to disappear
fully before starting the replacement, the failure does not occur.
Cisco Secure Endpoint appears to expose the race by greatly extending process
teardown time. I am not claiming that Cisco Secure Endpoint itself is the
underlying Codex defect. The desktop app appears to assume that the previous
app-server's SQLite mappings have already been released before starting the
replacement process.
Importantly, switching the ChatGPT desktop Agent Environment from Windows
native to WSL avoids the problem. WSL mode survives repeated full
quit/relaunch cycles successfully, while Windows-native mode continues to
reproduce the SQLite initialisation failure.
This further suggests that the problem is specific to the Windows-native Codex
runtime/process lifecycle rather than corruption of my account, sessions or
Codex home.
What steps can reproduce the bug?
- Use ChatGPT/Codex Desktop 26.924.2738.0 on Windows.
- Select the Windows-native Agent Environment.
- Use a Codex home which already contains its normal SQLite state databases.
- Fully quit and relaunch the desktop application.
- During startup, observe that the first codex.exe app-server starts and is
then terminated by the desktop app. - A replacement codex.exe starts approximately 2-3 seconds later.
- If teardown of the original process is still occurring, the replacement
process fails to initialise the SQLite state runtime.
Observed result:
failed to initialize sqlite state runtime under C:\Users<user>.codex
More direct reproduction:
- Start codex.exe against a Codex home containing the generated state DBs.
- Terminate that process approximately 1 second after startup.
- Start a second instance approximately 2.6 seconds later.
- The second instance reproduces the same SQLite initialisation failure.
- Repeat the test but wait approximately 20 seconds before starting instance 2.
- The second instance starts successfully.
On this machine, a terminated codex.exe takes approximately 15.6 seconds to
fully disappear, compared with tens of milliseconds for ordinary processes.
Process Monitor shows extensive reads of the codex.exe image during that
teardown. Cisco Secure Endpoint is installed and active.
Control test:
- Switch ChatGPT Desktop Agent Environment from Windows native to WSL.
- Fully quit the application.
- Relaunch repeatedly.
- WSL mode starts successfully across repeated relaunches and does not produce
the SQLite initialisation error.
What is the expected behavior?
The desktop app should successfully restart/relaunch its app-server even if
termination of the previous codex.exe process takes longer than usual.
In particular, it should not initialise/reset a SQLite shared-memory file while
the previous app-server process still has that file mapped.
Possible fixes might include:
- waiting for the previous process to have fully exited before launching the
replacement; - retrying SQLite initialisation when ERROR_USER_MAPPED_FILE occurs;
- delaying/retrying WAL/SHM reset while stale mappings remain;
- avoiding overlapping access to the state-runtime SHM file during app-server
restart.
The Windows-native runtime should behave robustly even when endpoint-security
software makes process teardown slower than normal.
Additional information
Troubleshooting already performed:
- Reset/reinstalled the desktop app.
- Created a completely fresh .codex directory.
- Tested old and freshly-created state databases.
- Recreated/moved memories_1.sqlite.
- Disabled plugins.
- Disabled memory-related feature flags.
- Checked SQLite integrity.
- Compared old and new Codex homes.
- Checked filesystem permissions/ownership.
- Reproduced the process timing independently.
- Tested WSL Agent Environment.
None of the Windows-native configuration changes provides a durable fix.
The existing SQLite databases and previous session data pass integrity checks
and do not appear to be the cause.
Importantly, a completely fresh Codex home can also develop the problem once
its databases have been created.
WSL mode works reliably on the same machine and survives repeated relaunches.
The issue began after the update to 26.924. The previous 26.917 build did not
show this behaviour on this PC.
There are also other recent Windows 26.924 reports where a fresh Codex home
works initially but subsequent launches fail, although I have not found another
public report that isolates the same Cisco Secure Endpoint / process-teardown /
SQLite SHM mechanism.
I can provide, if useful:
- Process Monitor traces showing both codex.exe processes and the
USER MAPPED FILE failure; - precise PID/start/termination timestamps;
- a small reproduction script demonstrating the timing race;
- relevant desktop/Codex logs.
I have deliberately not attached my complete .codex directory because it
contains account/session data.
Activity
gunwookim0221 commentedon Oct 27, 2026
I reproduced what appears to be the same failure outside AO/Orchestrator using a diagnostic build of Codex
rust-v0.164.0.Environment:
DESKTOP-H6PQG3O\smaniC:\Users\smani\.codexThe diagnostic build was instrumented only to expose the state-runtime initialization stage and underlying SQLite error chain.
The failure reproduced as:
SQLite extended result code
1546corresponds toSQLITE_IOERR_TRUNCATE.The top-level Codex failure was the usual:
Additional observations:
I have not yet captured the native Windows error underneath
SQLITE_IOERR_TRUNCATE, so I cannot confirmERROR_USER_MAPPED_FILE (1224)specifically. However, the failing database/stage and SQLite extended code are now confirmed.Diagnostic Codex baseline:
rust-v0.164.0commit:
6aaac694803004a63c6f393d153c96d22521a6b9