openai / openai/codex

[Wishlist] Pin Agent environment per project/thread instead of a global Windows/WSL toggle

Open
#37,936 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app enhancement session windows-os
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
  1. Project default: each project stores agentEnvironment = windows | wsl:<distro>.
  2. Thread pinning: a thread stores the environment, distro/host identity, and canonical cwd used when it was created.
  3. No retroactive mutation: changing the global/default environment affects only new projects or new threads.
  4. Explicit migration: reopening a thread under another environment requires an explicit fork/migrate action with a preview of cwd/path conversion.
  5. Visible identity: show a Windows or WSL badge plus canonical cwd in the thread header/sidebar.
  6. Mixed concurrent use: Windows projects may run with the Windows agent while WSL projects run with the WSL agent in the same Desktop session.
  7. Safe terminal default: the integrated terminal should inherit the thread's pinned environment unless explicitly overridden.
  8. 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.