Allow PowerShell or WSL execution environment to be selected per project and per chat
What variant of Codex are you using?
App
What feature would you like to see?
Title: Support per-project and per-chat Windows/WSL environments with reliable path handling
I regularly use Codex on Windows 11 with both Windows-native and WSL-native projects:
C:\platform-toolsrequires the Windows agent and PowerShell./home/mike/repos/PortfolioWatchrequires the WSL agent and an Ubuntu-22.04 terminal.
Currently, changing the Agent or Integrated Terminal between PowerShell and WSL behaves like a global setting. Switching environments can make existing chats appear to disappear, disrupt project grouping, break file and attachment links, and cause the file browser to resolve paths using the wrong environment.
For example, Codex can incorrectly reinterpret WSL paths as Windows paths and produce invalid hybrids such as C:\home\... or C:\mnt\....
These path forms need to remain distinct and be translated deliberately:
- Windows native:
C:\platform-tools - WSL native:
/home/mike/repos/PortfolioWatch - Windows access to WSL:
\\wsl.localhost\Ubuntu-22.04\home\mike\repos\PortfolioWatch - WSL access to Windows:
/mnt/c/...
Please add:
- A default execution environment for each saved project:
- Windows/PowerShell
- WSL, including distribution selection
- Inherit global default
- A per-chat environment override when creating or reopening a chat.
- Independent configuration of:
- Agent execution environment
- Integrated terminal shell
- Persistent environment identity for every chat, including its working directory and path format.
- Correct Windows-to-WSL and WSL-to-Windows path translation for the file browser, attachments and clickable file links.
- A consistent task list where chats remain visible regardless of the currently selected environment.
Expected behaviour:
- Opening
C:\platform-toolsautomatically restores the Windows agent and PowerShell terminal. - Opening
/home/mike/repos/PortfolioWatchautomatically restores the Ubuntu-22.04 WSL agent and terminal. - Windows-native and WSL-native chats can remain open simultaneously.
- Switching chats does not require changing a global setting or restarting Codex.
- Changing the integrated terminal does not reinterpret the chat’s working directory.
- The file browser never constructs invalid hybrid paths.
- Existing file and attachment links continue working after switching between Windows and WSL chats.
This would make Codex substantially more reliable for Windows power users who work across both native Windows and WSL projects every day.
Additional information
_No response_
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I am running into this exact problem on Windows 11 with WSL2 and would like to add a concrete workflow proposal.
I regularly work on both:
/home/....Today, the Codex desktop app treats the Agent Environment as a global setting. Moving between these projects requires opening Settings, switching between Windows native and WSL, and restarting the app. This is disruptive and makes it easy to run a command in the wrong environment. It also makes it difficult to keep Windows and WSL chats open at the same time.
The ideal solution would be similar to VS Code Remote - WSL:
As a fallback or complementary solution, please consider supporting independent local configuration roots for the stable and beta desktop apps. At present, the two Windows app variants share
%USERPROFILE%\\.codex, so settings such as the WSL agent selection affect both. An app-specific setting or environment variable could allow, for example:%USERPROFILE%\\.codex%USERPROFILE%\\.codex-betaIdeally the desktop app would honor an app-specific
CODEX_HOME(or provide an equivalent setting), with safe migration/copy support for auth, sessions, skills, and SQLite state.Per-project execution targets would solve the underlying workflow problem for most users; independent stable/beta configuration would provide a useful isolation mechanism for users who intentionally use the two builds for different environments.
This is related to #23071 and #17173, but I wanted to add the VS Code Remote-style connection model and the stable/beta configuration fallback as one concrete user workflow.
One more important part of this request is the quality of the Windows-side WSL workflow itself. The current experience is not comparable to VS Code Remote - WSL.
For a WSL-native repository, the Windows app currently makes users manually navigate or type paths such as
\\wsl.localhost\\Ubuntu\\home\\<user>\\<repo>in the Windows file picker. Opening a folder through the Windows UI does not reliably establish a durable WSL project connection, and the app can still treat the project as a Windows-side folder with/mnt/cor other hybrid path semantics.The Open in VS Code workflow also does not behave like VS Code Remote - WSL: it should open a WSL remote window connected to the selected distribution and Linux working directory, rather than merely opening the UNC path as a Windows folder. For example, a project at
/home/alice/src/projectin Ubuntu should open as a VS CodeWSL: Ubuntuworkspace rooted at/home/alice/src/project.A complete Windows + WSL experience should therefore include:
/home/...,/mnt/c/..., and\\wsl.localhost\\...paths.This would remove the repeated manual path selection and environment switching that currently makes Windows-side Codex much less convenient than VS Code for mixed Windows/WSL development.
Current-build reproducible failure: Windows-native task receives hybrid WSL/Windows runtime
I reproduced a concrete failure on 14 August 2026 (Europe/London) in Codex Desktop package 26.803.10989.0. This turns the environment-selection problem described in this issue into a command-blocking runtime defect.
Executive finding
A task presented as Windows native received all of the following simultaneously:
/bin/sh;This was not a Windows ACL/UAC or ComfyUI problem. No reviewed failure contained
Access denied, UAC refusal, Windows error 1385, or a sandbox policy denial. Process creation failed before the approved command could start.Malformed task path
The task workspace was shaped like this (username/project redacted):
This concatenates:
resourcesdirectory;C:\Users\...path.The task UI identified the task as Windows native, but its execution metadata and shell routing did not agree.
Exact command failures
A basic shell command failed before execution:
Using an explicitly valid Linux work directory such as
/tmpdid not fix it, so the malformed default cwd was not the only fault.An explicit PowerShell request was still rewritten to a Linux shell and failed:
Another observed failure was:
Therefore the selected PowerShell executable was not being honoured. A Windows process boundary was trying to launch missing Linux paths.
Approval/full-access behaviour
Approvals were accepted and saved for ordinary commands and an explicit Windows PowerShell executable, including
ls,find,jq,cp,ip,curl, and PowerShell itself. The task continued to prompt or fail.This is consistent with failure during environment classification/shell construction, before approval policy can make the requested process runnable. Repeatedly granting permissions cannot repair that state, which is why the UI made this look like a user permissions problem when it was not.
Independent application proof
The blocked task needed to reach a healthy local Windows service at
http://127.0.0.1:8188.127.0.0.1:8188/system_statssuccessfully.That isolates the failure to Codex Desktop task/runtime routing rather than the local service, firewall, Windows account, or workload.
Reproduction
C:\Users\<user>\Documents\Codex./mnt/c/.../app/resources/C:\Users\....pwd, including with/tmpas explicit workdir./bin/bash -lc pwdfailing through WindowsCreateProcesswithos error 2.powershell.exeand request$PSVersionTable.PSVersion./bin/sh -c.Expected behaviour
Official documentation says the Windows app uses the Windows-native agent by default, where commands run in PowerShell; WSL is a separate agent selection that requires a restart. A Windows-native task must therefore have one coherent contract for host platform, agent platform, cwd namespace, shell, sandbox, plugins, and local-loopback access.
Likely fault boundary
High confidence: Desktop task creation/handoff plus app-server environment state, specifically:
The task's local host ID was not sufficient to establish which OS runtime actually owned command execution.
User impact
Closely matching open reports
.../app/resources/C:\Users\...cwd plus Browser/Computer Use failure.CreateProcessattempt for/bin/bashandENOENT./bin/bash.This remains reproducible in the 26.803 package family. Please treat it as a current runtime bug, not only an enhancement request. Private task/thread IDs and sanitized logs can be supplied directly to OpenAI Support rather than posted publicly.