[Wishlist] Pin Agent environment per project/thread instead of a global Windows/WSL toggle
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125k
- Forks
- 19.5k
- PR merge metrics
- PR metrics pending
Description
Feature request
Allow Codex Desktop on Windows to select and persist Agent environment per project and per thread, instead of treating Windows vs WSL as a global toggle that retroactively changes how existing threads are resumed.
Motivation
A Windows workstation commonly contains both kinds of projects:
- native Windows repositories that should use the Windows agent/sandbox; and
- Linux repositories under
/home/...that should use the WSL agent, Linux filesystem semantics, and Linux tooling.
The current global toggle makes this mixed workflow unsafe. Switching from WSL to Windows can preserve a thread ID while changing the execution host and path dialect underneath it. Existing WSL rollouts can then fail to resume in the Windows backend with errors such as:
AbsolutePathBuf deserialized without a base path
It can also create invalid projections such as C:\home\<wsl-user> for a canonical WSL project.
Related evidence:
- #28094 — project/thread identity and cross-backend path/resume failures
- #37104 — WSL Agent integrated-terminal failures, while Windows Agent + WSL terminal can work
Requested behavior
- Project default: each project stores
agentEnvironment = windows | wsl:<distro>. - Thread pinning: a thread stores the environment, distro/host identity, and canonical cwd used when it was created.
- No retroactive mutation: changing the global/default environment affects only new projects or new threads.
- Explicit migration: reopening a thread under another environment requires an explicit fork/migrate action with a preview of cwd/path conversion.
- Visible identity: show a Windows or WSL badge plus canonical cwd in the thread header/sidebar.
- Mixed concurrent use: Windows projects may run with the Windows agent while WSL projects run with the WSL agent in the same Desktop session.
- Safe terminal default: the integrated terminal should inherit the thread's pinned environment unless explicitly overridden.
- Typed-path migration: if migration is supported, convert all persisted typed path fields and rollout metadata using a versioned migration rather than parsing them under a different host dialect.
Example
C:\src\windows-app→ Windows agent\\wsl$\Ubuntu\home\user\linux-app//home/user/linux-app→ WSL Ubuntu agent
Both projects should remain usable simultaneously, and switching the default for future projects should not change either existing thread.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing how Codex Desktop stores the global Windows/WSL environment toggle, project and thread identity, and canonical cwd. Then inspect the WSL/Windows path and rollout metadata handling, including the deserialization failure described in the issue. Done means existing threads remain pinned, new projects and threads use the selected default, and mixed Windows/WSL projects work concurrently without retroactive mutation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- desktop, operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100