Client or integration
Codex App
Area
Platform (Windows / Linux / WSL); Codex history integration
Summary
OpenCodex 2.11.1 ignores Codex's split SQLite location in the Windows Codex Desktop + WSL app-server layout.
Codex runs with a Windows-mounted main home while keeping SQLite-backed state on the WSL-native filesystem:
CODEX_HOME=/mnt/c/Users/<windows-user>/.codex
CODEX_SQLITE_HOME=/home/<wsl-user>/.codex/sqlite
The active state_5.sqlite is under CODEX_SQLITE_HOME, but OpenCodex history code derives it as $CODEX_HOME/state_5.sqlite. History sync/restore can therefore inspect or mutate an obsolete, empty, or unrelated database.
Expected: all state-database consumers should use one resolver with Codex-compatible precedence: sqlite_home config, then CODEX_SQLITE_HOME, then effective CODEX_HOME.
Reproduction
-
Run Windows Codex Desktop with the agent in WSL2 and this split layout:
export CODEX_HOME=/mnt/c/Users/<windows-user>/.codex
export CODEX_SQLITE_HOME=/home/<wsl-user>/.codex/sqlite
-
Confirm $CODEX_SQLITE_HOME/state_5.sqlite contains the current threads table.
-
Leave an empty or stale $HOME/.codex/state_5.sqlite or $CODEX_HOME/state_5.sqlite.
-
Run an OpenCodex history operation such as restore/uninstall while syncResumeHistory is enabled.
-
Observe that OpenCodex selects the stale database rather than the active database and fails on the missing schema.
Current code evidence:
const STATE_DB_PATH = join(CODEX_HOME, "state_5.sqlite");
A source search in 2.11.1 finds no handling for CODEX_SQLITE_HOME or the sqlite_home Codex option. The Linux service builder also does not propagate an explicitly supplied CODEX_SQLITE_HOME.
The public Codex environment reference documents the split state location and precedence:
https://learn.chatgpt.com/docs/config-file/environment-variables
Version
2.11.1
Operating system
Windows 11 with WSL2 / Ubuntu; Codex Desktop agent mode set to WSL
Logs or error output
Observed paths:
/mnt/c/Users/<windows-user>/.codex/config.toml
/home/<wsl-user>/.codex/sqlite/state_5.sqlite # active
/home/<wsl-user>/.codex/state_5.sqlite # obsolete, 0 bytes
Redacted configuration
{
"CODEX_HOME": "/mnt/c/Users/<windows-user>/.codex",
"CODEX_SQLITE_HOME": "/home/<wsl-user>/.codex/sqlite",
"syncResumeHistory": true
}
Checks
Safety and relationship
syncResumeHistory: false avoids the unsafe history path until fixed, at the cost of disabling history remapping.
Follow-up to #63. Companion service ownership issue: #1400.
Client or integration
Codex App
Area
Platform (Windows / Linux / WSL); Codex history integration
Summary
OpenCodex 2.11.1 ignores Codex's split SQLite location in the Windows Codex Desktop + WSL app-server layout.
Codex runs with a Windows-mounted main home while keeping SQLite-backed state on the WSL-native filesystem:
The active
state_5.sqliteis underCODEX_SQLITE_HOME, but OpenCodex history code derives it as$CODEX_HOME/state_5.sqlite. History sync/restore can therefore inspect or mutate an obsolete, empty, or unrelated database.Expected: all state-database consumers should use one resolver with Codex-compatible precedence:
sqlite_homeconfig, thenCODEX_SQLITE_HOME, then effectiveCODEX_HOME.Reproduction
Run Windows Codex Desktop with the agent in WSL2 and this split layout:
Confirm
$CODEX_SQLITE_HOME/state_5.sqlitecontains the currentthreadstable.Leave an empty or stale
$HOME/.codex/state_5.sqliteor$CODEX_HOME/state_5.sqlite.Run an OpenCodex history operation such as restore/uninstall while
syncResumeHistoryis enabled.Observe that OpenCodex selects the stale database rather than the active database and fails on the missing schema.
Current code evidence:
A source search in 2.11.1 finds no handling for
CODEX_SQLITE_HOMEor thesqlite_homeCodex option. The Linux service builder also does not propagate an explicitly suppliedCODEX_SQLITE_HOME.The public Codex environment reference documents the split state location and precedence:
https://learn.chatgpt.com/docs/config-file/environment-variables
Version
2.11.1
Operating system
Windows 11 with WSL2 / Ubuntu; Codex Desktop agent mode set to WSL
Logs or error output
Observed paths:
Redacted configuration
{ "CODEX_HOME": "/mnt/c/Users/<windows-user>/.codex", "CODEX_SQLITE_HOME": "/home/<wsl-user>/.codex/sqlite", "syncResumeHistory": true }Checks
Safety and relationship
syncResumeHistory: falseavoids the unsafe history path until fixed, at the cost of disabling history remapping.Follow-up to #63. Companion service ownership issue: #1400.