Codex Desktop WSL app-server injects CODEX_SQLITE_HOME and overrides sqlite_home

Open 💬 0 comments Opened Jul 11, 2026 by julesLubrano

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 -- env invocation did not contain CODEX_SQLITE_HOME;
  • config.toml parsed successfully and contained the intended top-level sqlite_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?

  1. Configure Codex Desktop on Windows to run its app-server in WSL.
  2. Close Desktop and ensure the old WSL app-server has exited.
  3. Copy valid Codex SQLite databases to a separate WSL-native directory.
  4. Set top-level sqlite_home to that directory.
  5. Remove CODEX_HOME and CODEX_SQLITE_HOME from shell_environment_policy.set.
  6. Verify that neither Windows nor a clean WSL environment defines CODEX_SQLITE_HOME.
  7. Start Codex Desktop.
  8. Inspect the environment of the fresh WSL app-server.
  9. Observe that Desktop injected an older CODEX_SQLITE_HOME, overriding the configured sqlite_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_HOME from sqlite_home;
  • reject the conflicting configuration with a clear diagnostic; or
  • document that sqlite_home cannot 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.

View original on GitHub ↗