[Wishlist] Pin Agent environment per project/thread instead of a global Windows/WSL toggle
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.
2 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
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:
No raw files or databases are needed. If you choose to share output, please review and sanitize any private repository paths or names first.