Client or integration
Codex App
Area
Service lifecycle; Platform (Windows / Linux / WSL)
Summary
In the Windows Codex Desktop + WSL app-server layout supported by #63, OpenCodex uses two different Codex-home resolvers.
Runtime/config paths use the WSL-aware resolver and discover the Windows Desktop home. Service install state instead uses CODEX_HOME || homedir()/.codex. A service installed from an ordinary WSL shell therefore records the Linux fallback in service-state.json, even though the proxy runtime resolves the Windows Codex home.
Later service repair or service uninstall commands run from the Desktop-injected environment report a false ownership mismatch or direct restore logic toward the wrong home.
Expected: service ownership metadata should use the same canonical resolver as the proxy runtime, without requiring CODEX_HOME to be baked into the systemd environment.
Reproduction
-
Use Windows Codex Desktop with the agent running in WSL2.
-
Ensure Linux ~/.codex/config.toml is absent and exactly one Windows Codex config is visible at /mnt/c/Users/<windows-user>/.codex/config.toml.
-
Run:
env -u CODEX_HOME -u OPENCODEX_HOME ocx status
OpenCodex correctly reports /mnt/c/Users/<windows-user>/.codex.
-
Install the Linux user service from the same ordinary WSL environment:
env -u CODEX_HOME -u OPENCODEX_HOME ocx service install
-
Inspect ~/.opencodex/service-state.json. Its codexHome is /home/<wsl-user>/.codex.
-
From a Codex Desktop WSL task, where CODEX_HOME=/mnt/c/Users/<windows-user>/.codex, run ocx service repair.
-
Observe the ownership mismatch between the recorded Linux home and the Desktop home.
Code path:
function currentCodexHome(): string {
const raw = process.env.CODEX_HOME?.trim();
return raw ? resolve(expandUserPath(raw)) : join(homedir(), ".codex");
}
This bypasses the WSL-aware resolver already used by normal runtime paths.
Version
2.11.1
Operating system
Windows 11 with WSL2 / Ubuntu; Codex Desktop agent mode set to WSL
Logs or error output
Service was installed with CODEX_HOME=/home/<wsl-user>/.codex,
but current CODEX_HOME=/mnt/c/Users/<windows-user>/.codex.
Redacted configuration
{
"desktopAgentMode": "WSL",
"linuxConfigPresent": false,
"windowsCodexHomeCandidates": 1
}
Checks
Relationship
Follow-up to #63. Companion split-SQLite issue: #1401.
Client or integration
Codex App
Area
Service lifecycle; Platform (Windows / Linux / WSL)
Summary
In the Windows Codex Desktop + WSL app-server layout supported by #63, OpenCodex uses two different Codex-home resolvers.
Runtime/config paths use the WSL-aware resolver and discover the Windows Desktop home. Service install state instead uses
CODEX_HOME || homedir()/.codex. A service installed from an ordinary WSL shell therefore records the Linux fallback inservice-state.json, even though the proxy runtime resolves the Windows Codex home.Later
service repairorservice uninstallcommands run from the Desktop-injected environment report a false ownership mismatch or direct restore logic toward the wrong home.Expected: service ownership metadata should use the same canonical resolver as the proxy runtime, without requiring
CODEX_HOMEto be baked into the systemd environment.Reproduction
Use Windows Codex Desktop with the agent running in WSL2.
Ensure Linux
~/.codex/config.tomlis absent and exactly one Windows Codex config is visible at/mnt/c/Users/<windows-user>/.codex/config.toml.Run:
OpenCodex correctly reports
/mnt/c/Users/<windows-user>/.codex.Install the Linux user service from the same ordinary WSL environment:
Inspect
~/.opencodex/service-state.json. ItscodexHomeis/home/<wsl-user>/.codex.From a Codex Desktop WSL task, where
CODEX_HOME=/mnt/c/Users/<windows-user>/.codex, runocx service repair.Observe the ownership mismatch between the recorded Linux home and the Desktop home.
Code path:
This bypasses the WSL-aware resolver already used by normal runtime paths.
Version
2.11.1
Operating system
Windows 11 with WSL2 / Ubuntu; Codex Desktop agent mode set to WSL
Logs or error output
Redacted configuration
{ "desktopAgentMode": "WSL", "linuxConfigPresent": false, "windowsCodexHomeCandidates": 1 }Checks
Relationship
Follow-up to #63. Companion split-SQLite issue: #1401.