Codex Desktop WSL app-server injects CODEX_SQLITE_HOME and overrides sqlite_home
What version of the Codex App are you using?
Codex Desktop Windows Store app 26.707.3748.0.
Bundled WSL Codex binary: codex-cli 0.144.0-alpha.4.
What platform is your computer?
Windows 11 x64 with WSL2 Ubuntu.
What issue are you seeing?
When Codex Desktop runs its app-server in WSL, a top-level sqlite_home setting is ignored because Desktop injects CODEX_SQLITE_HOME into the WSL app-server environment.
Sanitized target configuration:
sqlite_home = "/home/<linux-user>/.codex-desktop/sqlite"
[shell_environment_policy]
inherit = "all"
There is deliberately no shell_environment_policy.set entry for either CODEX_HOME or CODEX_SQLITE_HOME.
The four SQLite databases were copied to the target with the SQLite Backup API and each target database passed PRAGMA quick_check.
Before starting Desktop, all of the following were confirmed:
- no Codex Desktop Windows process was running;
- no prior WSL Codex app-server was running;
- Windows process, user, and machine environment scopes did not define
CODEX_SQLITE_HOME; - a clean
wsl.exe -d Ubuntu -- envinvocation did not containCODEX_SQLITE_HOME; config.tomlparsed successfully and contained the intended top-levelsqlite_home.
After starting Desktop, the newly created WSL app-server process contained:
CODEX_HOME=/mnt/c/Users/<windows-user>/.codex
CODEX_SQLITE_HOME=/home/<linux-user>/.codex/sqlite
The injected environment variable takes precedence over the top-level setting, so the app-server continues to use the old SQLite directory instead of /home/<linux-user>/.codex-desktop/sqlite.
This makes it impossible to configure the intended split layout:
Windows Desktop home: C:\Users\<windows-user>\.codex
Desktop WSL SQLite: /home/<linux-user>/.codex-desktop/sqlite
Independent WSL CLI: /home/<linux-user>/.codex
What steps can reproduce the bug?
- Configure Codex Desktop on Windows to run its app-server in WSL.
- Close Desktop and ensure the old WSL app-server has exited.
- Copy valid Codex SQLite databases to a separate WSL-native directory.
- Set top-level
sqlite_hometo that directory. - Remove
CODEX_HOMEandCODEX_SQLITE_HOMEfromshell_environment_policy.set. - Verify that neither Windows nor a clean WSL environment defines
CODEX_SQLITE_HOME. - Start Codex Desktop.
- Inspect the environment of the fresh WSL app-server.
- Observe that Desktop injected an older
CODEX_SQLITE_HOME, overriding the configuredsqlite_home.
What is the expected behavior?
Codex Desktop should honor top-level sqlite_home when launching its WSL app-server.
If Desktop intentionally owns this path, it should either:
- expose a supported Desktop setting for the WSL SQLite directory;
- update the injected
CODEX_SQLITE_HOMEfromsqlite_home; - reject the conflicting configuration with a clear diagnostic; or
- document that
sqlite_homecannot control Desktop-launched WSL app-servers.
Additional information
The migration was rolled back after the runtime validation failed.
No database corruption occurred, and both source and target database sets continued to pass PRAGMA quick_check.
This appears related to the broader Windows/WSL state-boundary problem discussed in #18506 and #24348, but the specific failure here is configuration precedence: a fresh Desktop-launched WSL app-server receives an environment override that is absent from every inspected user-controlled environment surface.