[App] Windows setup hangs after invalid TOML written to shell_environment_policy.set

Open
#33,790 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start with %CODEX_HOME%/config.toml handling for shell_environment_policy.set and the Windows “Finish Windows setup”/Retry path. Inspect how the malformed table header is written and how parse failures are handled. Done means config writes remain valid TOML and an invalid config produces a clear parse error instead of routing into the setup gate.

Written by the indexing model from the issue text.

Description

app bug config windows-os
What version of the Codex App are you using (From "About Codex" dialog)?

26.715.21425

What subscription do you have?

ChatGPT Plus

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What issue are you seeing?

After an app update and reboot, the app gets stuck on the "Finish Windows setup" screen ("ChatGPT necesita un permiso por única vez para funcionar en tu computadora"). The UAC dialog shown there never triggers a real Windows elevation prompt, and clicking "Retry" fails instantly — same symptom already reported in openai/codex#32149, openai/codex#32248 and openai/codex#32492.

Image

Root cause found on my machine: %CODEX_HOME%\config.toml contained invalid TOML. Instead of a normal inline table:

[shell_environment_policy]
set = {}

the file had a malformed, two-line table header with a comment embedded inside the brackets:

[# Explicit key/value overrides (always win). Default: {}
shell_environment_policy.set ]
BROWSER_USE_AVAILABLE_BACKENDS = "chrome"
NODE_REPL_TRUSTED_BROWSER_CLIENT_SHA256S = "..."
NODE_REPL_TRUSTED_CODE_PATHS = '...'

This is not valid TOML (a [table] header can't span two lines or contain a # before the key path), so config.toml fails to parse, and the app appears to misroute that failure into the "Finish Windows setup" gate instead of showing a config error.

What steps can reproduce the bug?
  1. Not fully reproducible on demand — it appears to happen when the app rewrites shell_environment_policy.set in config.toml, likely while persisting a new NODE_REPL_TRUSTED_BROWSER_CLIENT_SHA256S entry (browser-tool trust update) during/after an app update.
  2. After it happens, config.toml contains the malformed table header shown above, and the app hangs on "Finish Windows setup" on every subsequent launch, with "Retry" failing instantly.
  3. Workaround: close the app, rename config.toml (e.g. to config.toml.old), relaunch — the app regenerates a fresh, valid config.toml and starts normally.

Note: this isn't a one-off — I keep a version-controlled backup of this file, and the same shell_environment_policy.set corruption pattern shows up across multiple past syncs, meaning this write bug has recurred more than once on this machine.

What is the expected behavior?

config.toml writes should always produce valid TOML. If the file is ever invalid, the app should surface a clear "config.toml failed to parse: " message instead of silently hanging on the Windows sandbox setup screen with a non-functional Retry button.

Additional information

Happy to share a redacted copy of the corrupted config.toml if useful for reproducing the serializer bug. Related: openai/codex#32149, openai/codex#32248, openai/codex#32492.

Dominant language
Rust
Stars
125k
Forks
19.5k
Avg merge
1m
Merged PRs (30d)
1k

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.

More from openai/codex

All issues in openai/codex

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.