Repository navigation
Description
Client or integration
Other
Area
Platform (Windows / macOS / Linux)
Summary
On Windows the Desktop terminal command (#6816) reports phase: partial with machine-path-conflict when the Machine Path contains a directory with ocx.cmd, even when new terminals actually select the Desktop's ocx.exe first. machine_conflict() (desktop/src-tauri/src/cli_command_windows.rs:805-846) expands each Machine Path entry with ExpandEnvironmentStringsW inside the Desktop process, whose environment already has every variable resolved. Windows builds a new logon environment differently: on the affected machine the Machine Path is REG_EXPAND_SZ and contains %NVM_HOME%;%NVM_SYMLINK% (nvm-windows), and fresh processes keep those two entries literal, so nvm4w's ocx.cmd only arrives through the User Path — after the Desktop's entry. The CLI page therefore shows a conflict that does not exist, and a user may "fix" a working setup.
Reproduction
- Windows 11 with nvm-windows: Machine
Path(REG_EXPAND_SZ) contains%NVM_HOME%;%NVM_SYMLINK%, both defined as machine variables;C:\nvm4w\nodejsholds an npm-installedocx.cmd; the UserPathalso listsC:\nvm4w\nodejs. - Run the Desktop's terminal-command reconcile for an eligible install (reproduced at module level:
perform_selectedwithAction::Reconcilefrom an interactive scheduled task in session 1, against a staged copy of the installedopencodex-desktop.exeandocx.exe). - Status:
{"enabled":true,"configured":false,"phase":"partial","issues":["machine-path-conflict"]}; HKCUPathnow starts with the Desktop directory,REG_EXPAND_SZkept,notifyPending:false. - Open a new Windows Terminal tab with
--reloadEnvironment, an Explorer-launchedcmd, or a Task Schedulercmd, and runwhere ocx: the Desktop'socx.exeis listed first, ahead ofC:\nvm4w\nodejs\ocxandocx.cmd;echo %PATH%shows%NVM_HOME%;%NVM_SYMLINK%literal in the Machine part.
Version
dev d17a9f2 (2.82.0); installed Desktop 2.77.0
Operating system
Windows 11 Pro build 26200, x64
Provider and model
Not provider-specific
Logs or error output
PLAN {"changeKinds":["registry-expand"],"issues":["machine-path-conflict"], ...}
new Terminal tab, after the write:
PATH=C:\WINDOWS\system32;...;%NVM_HOME%;%NVM_SYMLINK%;...;C:\Users\<user>\ocx-probe-desktop;...;C:\nvm4w\nodejs;...
where ocx:
C:\Users\<user>\ocx-probe-desktop\ocx.exe
C:\nvm4w\nodejs\ocx
C:\nvm4w\nodejs\ocx.cmd
Screenshots and supporting files
Probe record: devlog/_plan/261010_cli_path_crossos_probe/029_wp3_outcome.md (rows W3-W5). Direction to evaluate: decide the conflict from the PATH a fresh logon process would get (for example CreateEnvironmentBlock for the current token with bInherit = FALSE, then the first directory holding ocx.{exe,com,cmd,bat}), and check that choice against real new-terminal results before adopting it. An entry that stays unexpanded in that block cannot shadow the Desktop.
Redacted configuration
Not applicable (no OpenCodex configuration involved).
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
docs(devlog): record the cross-OS probe of the desktop-owned CLI path (…
lidge-jun commentedon Oct 10, 2026
Fixed on
devby #6888 (squash84b9e88286). The Desktop terminal command now evaluatesmachine-path-conflictagainst a fresh-logon PATH built withCreateEnvironmentBlock, after the HKCU PATH commit. It only reports a conflict when a competingocxactually comes before the Desktop one. On Windows build 26200 the fix passed clippy with-D warningsandcargo test cli_command30/30, and a fresh-logon probe confirmed the PATH.