cannot finish Windows setup to continue

Open 💬 16 comments Opened Jul 10, 2026 by teanoaurora-lab
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the Codex App are you using (From “About Codex” dialog)?

Version 26.707.31428

What subscription do you have?

Plus

What platform is your computer?

Windows x64

What issue are you seeing?

<img width="380" height="95" alt="Image" src="https://github.com/user-attachments/assets/6a1f6a29-ea12-42f8-ba8e-c96715ddcb6d" /> - The User accept yes or no is not appearing. ChatGPT installer has the same issue :

<img width="901" height="871" alt="Image" src="https://github.com/user-attachments/assets/55a1702d-5c9e-43a8-84e3-1dc88d77437d" /> Yes or not question for authentication is not appearing on windows. Installed and uninstall it multiple times but the same issue appeared.

What steps can reproduce the bug?

Intall the application, and cannot move due to missing window notification.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

16 Comments

github-actions[bot] contributor · 1 month ago

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

  • #32149

Powered by Codex Action

tayyab910629 · 1 month ago

<img width="1067" height="824" alt="Image" src="https://github.com/user-attachments/assets/cda41da9-e664-4bbc-aeeb-4d26883d8ac7" /> I have the exact same issue i cant even skip this--

anordroberts · 1 month ago

I have the same issue too

tayyab910629 · 1 month ago

Fixed! 👍

The issue was caused by the config.toml file inside the .codex folder.

First, completely close the chatgpt app using task manager. then go to the folder where Codex is installed, open the .codex folder, and find the config.toml file.

Rename it to something like: config.toml.old

Then open the chatgpt app again. It will automatically create a new config.toml file, and everything should work.

This is the safest option. Do not delete the entire .codex folder, as you could lose your backups or other saved data.

anordroberts · 1 month ago

Thank you so much. It works now

On Sat, 11 Jul 2026, 21:06 Tayyab, @.***> wrote:

tayyab910629 left a comment (openai/codex#32248) <https://github.com/openai/codex/issues/32248#issuecomment-4948215469> Fixed! 👍 The issue was caused by the config.toml file inside the .codex folder. First, completely close the chatgpt app using task manager. then go to the folder where Codex is installed, open the .codex folder, and find the config.toml file. Rename it to something like: config.toml.old Then open the chatgpt app again. It will automatically create a new config.toml file, and everything should work. This is the safest option. Do not delete the entire .codex folder, as you could lose your backups or other saved data. — Reply to this email directly, view it on GitHub <https://github.com/openai/codex/issues/32248?email_source=notifications&email_token=AKBIWEHGS7BSRGGML2XEBRT5EJ6ZPA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIOJUHAZDCNJUGY42M4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4948215469>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AKBIWEHKDQWOYWIQ362XDBD5EJ6ZPAVCNFSNUABFKJSXA33TNF2G64TZHM4TMNJUGE2TMNBZHNEXG43VMU5TIOBVHAYDMMJQGA42C5QC> . You are receiving this because you commented.Message ID: @.***>
heinerborle · 1 month ago

I've discovered another critical root cause for the "Finish Windows setup" hang (where the UAC prompt never triggers) that is related to authentication rather than Windows privileges or system features.

The Underlying Issue

If your user session has expired or the OAuth refresh token has been revoked, the desktop app fails to fetch the cloud configuration bundle (cloudConfigBundle) during startup:

failed to load configuration: Your access token could not be refreshed because your refresh token was revoked. Please log out and sign in again.

This causes the backend windowsSandbox/setupStart call to fail with a 401 Unauthorized / Auth error. Instead of displaying a prompt to log out and log in again, the Desktop UI incorrectly routes this error to the "Finish Windows setup" gate, making it appear as a permissions/sandbox setup failure.

The Fix / Workaround

To break the loop and force the app to show the login screen:

  1. Close the ChatGPT/Codex Desktop application completely.
  2. Open File Explorer and navigate to your user profile directory: %USERPROFILE%\.codex (usually C:\Users\<username>\.codex).
  3. Locate the file named auth.json.
  4. Rename auth.json to auth.json.bak (or delete it).
  5. Relaunch the ChatGPT/Codex app.

The app will now detect that no login session exists, skip the sandboxing gate, and successfully route you to the Sign In screen. Once you log back in, a fresh OAuth session will be established, and the app will open normally.

AhmedHossamFCI · 1 month ago
Fixed! 👍 The issue was caused by the config.toml file inside the .codex folder. First, completely close the chatgpt app using task manager. then go to the folder where Codex is installed, open the .codex folder, and find the config.toml file. Rename it to something like: config.toml.old Then open the chatgpt app again. It will automatically create a new config.toml file, and everything should work. This is the safest option. Do not delete the entire .codex folder, as you could lose your backups or other saved data.

Thank u u save my life

tajemniktv · 1 month ago

Just had that happen to me. It was a malformed config as others have mentioned.
Possible fix would be to try to reparse it. Workaround could include forcing a new config while backing up the old one (obv done by the app automatically)

mahmood98j · 1 month ago

I was able to fix this issue with a permissions workaround, with help from ChatGPT.

My symptoms

  • ChatGPT Desktop was installed from the Microsoft Store.
  • When I clicked the Windows setup / permission step, the UAC modal eventually appeared and I could approve it.
  • However, after approving the UAC prompt, ChatGPT still showed:
Windows setup didn’t finish
  • Running ChatGPT as Administrator did not fix it.
  • Renaming config.toml did not fix it.
  • The usual non-Store folders like %LOCALAPPDATA%\ChatGPT, %APPDATA%\ChatGPT, and %LOCALAPPDATA%\Programs\ChatGPT did not exist on my system.

What fixed it

I closed ChatGPT completely, then opened PowerShell as Administrator and ran this:

taskkill /IM ChatGPT.exe /F 2>$null
taskkill /IM codex.exe /F 2>$null

$me = "$env:USERDOMAIN\$env:USERNAME"
$codex = Join-Path $env:USERPROFILE ".codex"
$sandbox = Join-Path $codex ".sandbox"
$marker = Join-Path $sandbox "setup_marker.json"

New-Item -ItemType Directory -Force $codex | Out-Null

icacls $codex /inheritance:e
icacls $codex /grant "${me}:(OI)(CI)F" /T /C

if (Test-Path $marker) {
    icacls $marker /grant "${me}:F"
    Write-Host "setup_marker.json permission fixed"
} else {
    Write-Host "setup_marker.json not found yet; retry setup once in ChatGPT, then run this command again if it still fails."
}

In my case the output included something like:
Successfully processed 10184 files; Failed processing 0 files
processed file: C:\Users\USERNAME\.codex\.sandbox\setup_marker.json
Successfully processed 1 files; Failed processing 0 files
setup_marker.json permission fixed

After that, I opened ChatGPT normally, not as Administrator, approved the Windows permission prompt again, and the setup completed successfully. The error disappeared.

So in my case, the issue seems to have been caused by incorrect permissions on the .codex folder and/or the .codex\.sandbox\setup_marker.json file.

nol-n · 1 month ago
I was able to fix this issue with a permissions workaround, with help from ChatGPT. ### My symptoms ChatGPT Desktop was installed from the Microsoft Store. When I clicked the Windows setup / permission step, the UAC modal eventually appeared and I could approve it. However, after approving the UAC prompt, ChatGPT still showed: > Windows setup didn’t finish Running ChatGPT as Administrator did not fix it. Renaming config.toml did not fix it. The usual non-Store folders like %LOCALAPPDATA%\ChatGPT, %APPDATA%\ChatGPT, and %LOCALAPPDATA%\Programs\ChatGPT did not exist on my system. ### What fixed it I closed ChatGPT completely, then opened PowerShell as Administrator and ran this: taskkill /IM ChatGPT.exe /F 2>$null taskkill /IM codex.exe /F 2>$null $me = "$env:USERDOMAIN\$env:USERNAME" $codex = Join-Path $env:USERPROFILE ".codex" $sandbox = Join-Path $codex ".sandbox" $marker = Join-Path $sandbox "setup_marker.json" New-Item -ItemType Directory -Force $codex | Out-Null icacls $codex /inheritance:e icacls $codex /grant "${me}:(OI)(CI)F" /T /C if (Test-Path $marker) { icacls $marker /grant "${me}:F" Write-Host "setup_marker.json permission fixed" } else { Write-Host "setup_marker.json not found yet; retry setup once in ChatGPT, then run this command again if it still fails." } In my case the output included something like: Successfully processed 10184 files; Failed processing 0 files processed file: C:\Users\USERNAME.codex.sandbox\setup_marker.json Successfully processed 1 files; Failed processing 0 files setup_marker.json permission fixed After that, I opened ChatGPT normally, not as Administrator, approved the Windows permission prompt again, and the setup completed successfully. The error disappeared. So in my case, the issue seems to have been caused by incorrect permissions on the .codex folder and/or the .codex.sandbox\setup_marker.json file.

Thanks! Spent an hour trying to fix this. Other fixes do not work - this one did!

ard12 · 1 month ago
### What version of the Codex App are you using (From “About Codex” dialog)? Version 26.707.31428 ### What subscription do you have? Plus ### What platform is your computer? Windows x64 ### What issue are you seeing? <img alt="Image" width="380" height="95" src="https://private-user-images.githubusercontent.com/252189556/620211893-6a1f6a29-ea12-42f8-ba8e-c96715ddcb6d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODUxNzc4NjcsIm5iZiI6MTc4NTE3NzU2NywicGF0aCI6Ii8yNTIxODk1NTYvNjIwMjExODkzLTZhMWY2YTI5LWVhMTItNDJmOC1iYThlLWM5NjcxNWRkY2I2ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcyN1QxODM5MjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT05M2RmOWZmODE4Nzg4ZTNlNWZiNjQ4MTQ5ZDFmMGUxMzlhOGEwOWFlYWNhMjBkMThkNGI1NzFlZDlkYmUyMGQyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.BFvslPYI86iC-wk8sA4XBYEXJm8fql3I1EprBBR80HI"> - The User accept yes or no is not appearing. ChatGPT installer has the same issue : <img alt="Image" width="901" height="871" src="https://private-user-images.githubusercontent.com/252189556/620213323-55a1702d-5c9e-43a8-84e3-1dc88d77437d.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODUxNzc4NjcsIm5iZiI6MTc4NTE3NzU2NywicGF0aCI6Ii8yNTIxODk1NTYvNjIwMjEzMzIzLTU1YTE3MDJkLTVjOWUtNDNhOC04NGUzLTFkYzg4ZDc3NDM3ZC5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjYwNzI3JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI2MDcyN1QxODM5MjdaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0wZDk2OWI3ODQ1MTNlYzQ2Mjc2MmEwYzAwYWIzYjVhZjA2ZjVmNTliM2ZjMzIzNzI1NzUyNjQ1M2EwYThlNWFjJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZyZXNwb25zZS1jb250ZW50LXR5cGU9aW1hZ2UlMkZwbmcifQ.m_FA7ctCb35OM4wa0noCSa5STbGBp8pTdT9W7jPIA24"> Yes or not question for authentication is not appearing on windows. Installed and uninstall it multiple times but the same issue appeared. ### What steps can reproduce the bug? Intall the application, and cannot move due to missing window notification. ### What is the expected behavior? _No response_ ### Additional information _No response_

ChatGPT/Codex Windows: "Finish Windows setup" Troubleshooting

Symptom

The Windows desktop app is stuck on Finish Windows setup.

Common behavior:

  • Clicking Try Windows setup again fails immediately.
  • The app shows Windows setup didn't finish.
  • A Windows UAC prompt never appears.
  • Continue with limited access may not work or simply returns to the setup screen.

Work through the steps below in order. Stop as soon as the app starts working.

---

1. Close ChatGPT/Codex completely

  1. Close the app.
  2. Open Task Manager (Ctrl + Shift + Esc).
  3. End any remaining processes named similar to:
  • ChatGPT
  • Codex
  • OpenAI
  1. Wait a few seconds before reopening the app.

---

2. Back up and reset config.toml (main fix)

Press Win + R and open:

%USERPROFILE%\.codex

Find:

config.toml

Rename it to:

config.toml.backup
Do not delete the entire .codex folder.

Reopen ChatGPT/Codex.

Click Try Windows setup again.

If Windows displays a UAC prompt and the publisher is OpenAI LLC, approve it.

The app should generate a fresh config.toml.

If this fixes the problem

Keep config.toml.backup for now.

Don't immediately copy the old file back.

Instead:

  • Reapply custom settings one section at a time.
  • Restart the app after each change.
  • Identify the setting that causes the problem.

Optional: Diagnose the old file

If you have Node.js installed:

npx @openai/codex resume

A malformed TOML file may report the exact line and column.

Check for:

  • Missing closing quotes
  • Missing closing brackets
  • Invalid table headers
  • Broken [projects.'...'] entries
  • Project paths containing apostrophes or non-ASCII characters
  • Duplicate sections
  • Incorrect nesting

Example:

# Invalid
[projects.'D:\code\ExampleProject]

# Valid
[projects.'D:\code\ExampleProject']

Correct only the malformed lines whenever possible.

---

3. Terminate, Repair, and Reset the Windows app

Open:

Settings → Apps → Installed apps → ChatGPT → Advanced options

Test after each step.

  1. Terminate
  2. Reopen the app
  3. If needed, Repair
  4. Test again
  5. If needed, Reset
Reset removes local app data and signs you out.

After Reset:

  • Restart Windows
  • Open ChatGPT
  • Sign in again
  • Retry Windows setup

---

4. Clear the Microsoft Store cache

Close ChatGPT and Microsoft Store.

Press Win + R and run:

wsreset.exe

A blank command window may appear.

When Microsoft Store opens:

Library → Get updates

Update:

  • Microsoft Store
  • App Installer
  • ChatGPT
  • Windows Web Experience Pack (if available)

Restart Windows and retry setup.

---

5. Clear safe Windows temporary files

Open:

Settings → System → Storage → Temporary files

Generally safe to remove:

  • Temporary files
  • DirectX Shader Cache
  • Delivery Optimization Files
  • Thumbnails

Be careful with:

  • Downloads
  • Recycle Bin
  • Previous Windows installation files

Restart Windows afterward.

Do not manually delete random folders from AppData, Program Files, or .codex.

---

6. Sign out and sign back in

If you can reach account settings:

  1. Sign out
  2. Close ChatGPT completely
  3. Restart Windows
  4. Open ChatGPT
  5. Sign in again
  6. Retry setup

If you can't reach sign-in, continue.

---

7. Check Kaspersky reports

Immediately after reproducing the failure:

Open Kaspersky → Timeline / Reports / Security Reports

Look for entries matching:

  • ChatGPT
  • Codex
  • OpenAI
  • node.exe
  • sandbox
  • blocked
  • denied
  • restricted
  • terminated

Record:

  • Executable path
  • Detection reason
  • Kaspersky component
  • Action taken
Don't create broad exclusions unless Kaspersky identifies the exact legitimate executable being blocked.

---

8. Briefly test with Kaspersky paused

Only do this if:

  • ChatGPT was installed from an official source.
  • Windows identifies the publisher as OpenAI LLC.
  1. Close ChatGPT.
  2. Pause Kaspersky for the shortest available time.
  3. Open ChatGPT.
  4. Retry setup.
  5. Immediately re-enable protection.

Interpretation:

  • ✅ Works only while paused → Kaspersky is likely interfering.
  • ❌ Same failure → Kaspersky probably isn't the cause.
  • ✅ UAC appears only while paused → Kaspersky may be blocking the setup helper.
Don't exclude the entire .codex folder.

---

9. Check Windows Security Protection History

Open:

Windows Security → Virus & threat protection → Protection history

Look for events involving:

  • ChatGPT
  • Codex
  • OpenAI
  • SmartScreen
  • Controlled Folder Access
  • Potentially unwanted apps
  • Quarantined or blocked files

Verify the publisher before allowing anything.

---

10. Check Event Viewer

Open:

eventvwr.msc

Retry setup to generate a fresh event.

Inspect:

Applications and Services Logs
└─ Microsoft
   └─ Windows
      ├─ AppLocker
      │  ├─ EXE and DLL
      │  ├─ MSI and Script
      │  └─ Packaged app-Execution
      └─ CodeIntegrity
         └─ Operational

Look for warnings or errors created at the exact failure time.

---

11. Update Windows

Open:

Settings → Windows Update

Install all available:

  • Security updates
  • Cumulative updates
  • Microsoft Store-related updates

Restart Windows even if not prompted.

Retry setup.

---

12. Repair Windows system files

Run an elevated Windows Terminal:

sfc /scannow

Then:

DISM /Online /Cleanup-Image /RestoreHealth

Restart Windows.

Run one more time:

sfc /scannow

Retry setup.

---

13. Reinstall ChatGPT

Back up:

%USERPROFILE%\.codex\config.toml

Uninstall ChatGPT.

Restart Windows.

Run:

wsreset.exe

Install ChatGPT again from the Microsoft Store.

Launch it before restoring the old configuration.

Restore custom settings manually one section at a time.

---

14. Restore the original configuration (optional)

If the new configuration causes another issue:

Close ChatGPT.

Open:

%USERPROFILE%\.codex

Rename:

config.toml

to:

config.toml.new

Rename:

config.toml.backup

back to:

config.toml

Reopen the app.

Restoring the old file may also restore the original setup loop.

---

Recommended troubleshooting order

  1. Close all ChatGPT/Codex processes.
  2. Rename config.toml → config.toml.backup.
  3. Retry setup.
  4. Validate the old TOML with:

``powershell
npx @openai/codex resume
``

  1. Terminate → Repair → Reset the app.
  2. Run wsreset.exe.
  3. Update Microsoft Store, App Installer, ChatGPT, and Windows.
  4. Clear safe temporary files.
  5. Sign out and back in.
  6. Check Kaspersky reports.
  7. Test briefly with Kaspersky paused.
  8. Check Windows Security Protection History.
  9. Check AppLocker and CodeIntegrity logs.
  10. Run SFC and DISM.
  11. Reinstall ChatGPT.

---

Result from this case

Renaming:

%USERPROFILE%\.codex\config.toml

to:

config.toml.backup

allowed the app to generate a clean configuration and complete startup.

This suggests that a malformed, stale, or incompatible config.toml can be surfaced by the desktop app as a generic "Finish Windows setup" or sandbox failure rather than a configuration error.

hasemon · 1 month ago
I was able to fix this issue with a permissions workaround, with help from ChatGPT. ### My symptoms ChatGPT Desktop was installed from the Microsoft Store. When I clicked the Windows setup / permission step, the UAC modal eventually appeared and I could approve it. However, after approving the UAC prompt, ChatGPT still showed: > Windows setup didn’t finish Running ChatGPT as Administrator did not fix it. Renaming config.toml did not fix it. The usual non-Store folders like %LOCALAPPDATA%\ChatGPT, %APPDATA%\ChatGPT, and %LOCALAPPDATA%\Programs\ChatGPT did not exist on my system. ### What fixed it I closed ChatGPT completely, then opened PowerShell as Administrator and ran this: taskkill /IM ChatGPT.exe /F 2>$null taskkill /IM codex.exe /F 2>$null $me = "$env:USERDOMAIN\$env:USERNAME" $codex = Join-Path $env:USERPROFILE ".codex" $sandbox = Join-Path $codex ".sandbox" $marker = Join-Path $sandbox "setup_marker.json" New-Item -ItemType Directory -Force $codex | Out-Null icacls $codex /inheritance:e icacls $codex /grant "${me}:(OI)(CI)F" /T /C if (Test-Path $marker) { icacls $marker /grant "${me}:F" Write-Host "setup_marker.json permission fixed" } else { Write-Host "setup_marker.json not found yet; retry setup once in ChatGPT, then run this command again if it still fails." } In my case the output included something like: Successfully processed 10184 files; Failed processing 0 files processed file: C:\Users\USERNAME.codex.sandbox\setup_marker.json Successfully processed 1 files; Failed processing 0 files setup_marker.json permission fixed After that, I opened ChatGPT normally, not as Administrator, approved the Windows permission prompt again, and the setup completed successfully. The error disappeared. So in my case, the issue seems to have been caused by incorrect permissions on the .codex folder and/or the .codex.sandbox\setup_marker.json file.

If config.toml rename does not work for you then this will work 100%

mikedunlap1 · 1 month ago

Workaround found on Windows 11 build 26200 with Codex 26.721.4979.0:

Codex was stuck on “Finish Windows setup.” Clicking the button immediately failed without displaying the real UAC permission prompt.

Before finding the workaround, I tried:

  • Restarting Windows
  • Running Codex as administrator
  • Uninstalling and reinstalling Codex
  • Resetting the app
  • Changing the Windows UAC notification level
  • Confirming that UAC worked normally with Windows Terminal
  • Checking the Microsoft Store for updates through Winget
  • Confirming that I already had the latest Codex version

What finally worked:

I opened the Microsoft Store, navigated directly to the Codex store page, and clicked “Open.” Codex launched from the Store and successfully completed the Windows setup.

Well good luck y'all.

Ornn8 · 29 days ago

I encountered the same “Complete Windows setup” loop on Windows x64.

Environment

  • Codex / ChatGPT Windows app package: OpenAI.Codex 26.721.11231.0
  • Windows x64
  • ChatGPT Plus

What happened

Codex was working normally shortly before the issue. My PC then had an unexpected restart while the app was running.

After that:

  • Clicking Retry Windows setup did not open a UAC prompt.
  • Continue with restricted access did not work.
  • Repairing, resetting, uninstalling, and reinstalling the Microsoft Store app did not fix it.
  • UAC itself was working normally (EnableLUA=1, ConsentPromptBehaviorAdmin=5, PromptOnSecureDesktop=1).
  • The existing sandbox log was old and contained successful setup entries, but clicking Retry produced no new sandbox log entries.
  • %USERPROFILE%\.codex\.codex-global-state.json was malformed and could not be parsed as JSON.
  • Renaming only config.toml, rebuilding only .codex-global-state.json, and switching between elevated/unelevated sandbox modes did not fix my case.

Workaround that fixed it

First, I backed up %USERPROFILE%\.codex.

Then I completely closed ChatGPT/Codex and isolated both the Codex user-state directory and the old local runtime directory:

Get-Process ChatGPT,Codex -ErrorAction SilentlyContinue |
    Stop-Process -Force

$stamp = Get-Date -Format "yyyyMMdd-HHmmss"

if (Test-Path "$env:LOCALAPPDATA\OpenAI\Codex") {
    Rename-Item `
        "$env:LOCALAPPDATA\OpenAI\Codex" `
        "Codex.old-$stamp"
}

if (Test-Path "$HOME\.codex") {
    Rename-Item `
        "$HOME\.codex" `
        ".codex.old-$stamp"
}

After that I went to:

Windows Settings → Apps → Installed apps → ChatGPT → Advanced options → Reset

I then launched the app normally, without running it as Administrator. The application initialized successfully and the Windows setup loop was gone.

Notes

  • Reinstalling the Microsoft Store package alone was not sufficient because the two directories above remained.
  • This workaround does not delete data; it only renames the directories.
  • Users should back up .codex first.
  • Old state databases, .codex-global-state.json, *-wal, and *-shm files should not immediately be restored.
  • Configuration, sessions, rules, skills, and other user data can be restored selectively after confirming that the clean app starts correctly.

It may be useful for the app to detect malformed local state after an unexpected shutdown and automatically fall back to a clean state instead of blocking on the Windows setup screen.

t04dJ14n9 · 23 days ago

I also encountered this issue after letting codex to manipulate the ~/.codex/config.toml files on windows. I changed the config file from BOM form to non-BOM form and solved it.

soaringonline-dev · 11 days ago

删掉config文件