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

Open 💬 2 comments Opened Aug 11, 2026 by fenicottero-loriot
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

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.

View original on GitHub ↗

2 Comments

github-actions[bot] contributor · 17 days ago

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #36608

Powered by Codex Action

boombx403-byte · 9 days ago

Hi @fenicottero-loriot, your report looks related to a local session discovery/inventory gap rather than necessarily a lost rollout. I've released Codex Rescue Alpha5, a local read-only diagnostic tool that performs filesystem-first discovery across active and archived rollouts and cross-references SQLite/index metadata without modifying any state.

If you still have the affected local Codex directory, you can inspect it via:

pip install codex-rescue==0.1.0a5
codex-rescue sessions --json

No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.