openai / openai/codex

[Windows][WSL] Switching back to Windows Native fails with repeated UAC prompts and `config_load`; config changes do not persist

Open
#42,938 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug config windows-os
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

What platform is your computer?

Windows 11 x64 with WSL2 / Ubuntu.

Subscription

ChatGPT Prolite.

Codex App version

Current Windows desktop build installed as of 2026-09-05. I did not capture the exact About-version number before reproducing this issue.

What issue are you seeing?

Codex Desktop is effectively stuck in the WSL agent environment. Switching the app back to Windows Native does not complete successfully.

The app is currently configured with WSL in Settings:

Agent Environment = Windows Subsystem for Linux
Integrated terminal shell = WSL

The corresponding C:\Users\<user>\.codex\config.toml values were:

[desktop]
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"

I manually changed only those two values to:

runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"

After saving and reopening the app, Settings still showed WSL for both the Agent Environment and integrated terminal shell. In other words, the manual configuration change was either ignored or rewritten by the app.

I then tried switching the Agent Environment to Windows Native directly in the UI. Codex shows a Windows setup screen asking for a one-time administrator authorization. The Windows UAC prompt appears normally and identifies ChatGPT / OpenAI LLC as the verified publisher.

Even after approving the UAC prompt repeatedly, setup never completes. The app returns to:

Finish Windows setup
Windows installation did not finish
config_load

Pressing “Retry Windows setup” and approving UAC again produces the same result every time.

This leaves the app stuck: WSL mode is problematic, but switching back to Windows Native cannot complete because the Windows setup path repeatedly fails with config_load.

WSL itself is working

This does not appear to be a general WSL failure.

Cursor is connected to WSL/Ubuntu successfully and projects stored under the native WSL filesystem continue to work normally. For example, a project under a path like:

/home/<user>/projects/...

can be opened in Cursor and development processes such as npx convex dev can run normally.

Running wsl --shutdown temporarily disconnected Cursor, as expected, but reconnecting to Ubuntu restored the project and files normally. No WSL files were lost.

The problem appears specific to Codex Desktop's Agent Environment / Windows provisioning and configuration persistence.

Steps to reproduce
  1. Run Codex Desktop on Windows 11 with WSL2 / Ubuntu installed.
  2. Set:
Agent Environment = Windows Subsystem for Linux
Integrated terminal shell = WSL
  1. Confirm that C:\Users\<user>\.codex\config.toml contains:
runCodexInWindowsSubsystemForLinux = true
integratedTerminalShell = "wsl"
  1. Fully close Codex Desktop.
  2. Manually change those values to:
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"
  1. Save the file and reopen Codex Desktop.
  2. Observe that Settings still shows WSL as the Agent Environment and terminal shell.
  3. In Settings, attempt to switch Agent Environment to Windows Native.
  4. Codex displays the “Finish Windows setup” screen and triggers a Windows UAC prompt.
  5. Click Yes on the UAC prompt.
  6. Setup fails and returns to:
Windows installation did not finish
config_load
  1. Click Retry Windows setup and approve UAC again.
  2. The same config_load failure repeats indefinitely.
Expected behavior

Either of the following should work reliably:

  1. Changing the Agent Environment to Windows Native in the UI should complete Windows provisioning after one successful UAC approval; or
  2. The persisted config.toml values should be respected on restart when set to:
runCodexInWindowsSubsystemForLinux = false
integratedTerminalShell = "powershell"

After switching, Settings should show:

Agent Environment = Windows Native
Integrated terminal shell = PowerShell

while WSL/Ubuntu remains independently usable by other applications such as Cursor.

Actual behavior
  • Codex remains configured for WSL after manually changing the config file.
  • Switching to Windows Native through the UI launches Windows setup.
  • UAC approval succeeds, but Codex reports config_load and never finishes Windows setup.
  • Retrying produces the same loop.
Impact

This blocks normal use of Codex Desktop on the machine. The user can continue developing inside WSL with Cursor, but Codex Desktop cannot be reliably moved back to Windows Native and the WSL integration remains problematic.

Troubleshooting already attempted
  • Verified .codex directory and active config files.
  • Inspected .codex-global-state.json for WSL-related state.
  • Located [desktop] settings in config.toml.
  • Created backups before editing configuration.
  • Changed only:
    • runCodexInWindowsSubsystemForLinux = truefalse
    • integratedTerminalShell = "wsl""powershell"
  • Saved and restarted the app.
  • Confirmed the UI still reported WSL afterward.
  • Ran wsl --shutdown once to clear WSL state; WSL restarted normally later and existing projects were intact.
  • Tried the in-app Windows Native switch.
  • Approved the Windows UAC prompt multiple times.
  • Retried Windows setup multiple times.
  • Failure remains config_load.
Additional information

Screenshots are available showing:

  1. Settings with Agent Environment = Windows Subsystem for Linux and Shell = WSL.
  2. config.toml after being manually changed to false / powershell.
  3. The “Finish Windows setup” screen with the OpenAI/ChatGPT UAC prompt.
  4. The failure message:
Windows installation did not finish
config_load

No credentials, tokens, repository secrets, or private source code are required to reproduce the issue.

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

Reproduce the Windows 11/WSL2 flow using the reported Agent Environment and integrated shell settings. Start by comparing config.toml with .codex-global-state.json while switching to Windows Native and retrying the UAC setup; done means the Windows setup completes once and the selected values persist after restart without the config_load loop.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.