Windows power loss zero-fills config.toml and hangs desktop + VS Code Codex

Open
#34,126 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
38/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
rust
Domain
desktop, devtools

Research direction

Start by tracing the config/read path and the handling of ~/.codex/config.toml, using the reported Windows logs and zero-filled file as the reproduction. Review how malformed configuration is handled by the desktop app and VS Code extension. Done means corrupted shared state no longer leaves either client hanging and recovery produces defaults or an actionable error.

Written by the indexing model from the issue text.

Description

app bug config extension windows-os
Summary

After an unexpected Windows power loss, ~/.codex/config.toml became a 4,146-byte file containing only 0x00 bytes. Both the Codex Windows desktop app and the Codex VS Code extension then hung indefinitely during startup.

The desktop app, extension, Windows, and machine had all been restarted. Repairing/resetting and reinstalling the app did not resolve the problem because the corrupted shared configuration remained in ~/.codex.

Replacing the corrupted file with an empty, valid config.toml immediately restored both clients.

Environment
  • Windows 11, build 26100
  • Codex desktop: 26.715.4045.0
  • VS Code Codex extension: 26.715.31925-win32-x64
  • Shared config path: C:\Users\Administrator\.codex\config.toml
  • Official feedback thread: 019f78da-15b2-7a72-a9c4-897fd7a5bcdd
Observed behavior
  1. Windows lost power unexpectedly.

  2. After reboot, Codex desktop remained on the loading/splash screen indefinitely.

  3. The VS Code Codex extension also remained stuck and did not become usable.

  4. Restarting processes and Windows, updating, repairing/resetting, and reinstalling did not fix either client.

  5. Inspection showed that config.toml was exactly 4,146 bytes long and every byte was 0x00:

    TotalBytes=4146
    ZeroBytes=4146
    NonZeroBytes=0
    FirstNonZeroOffset=-1
    LastNonZeroOffset=-1
    
  6. Both desktop and extension logs repeatedly reported configuration-read failures.

Relevant log messages

VS Code extension:

codex_app_server: Invalid configuration; using defaults.
C:\Users\Administrator\.codex\config.toml:1:4147: key with no value, expected `=`

failed to read configuration layers:
C:\Users\Administrator\.codex\config.toml:1:4147: key with no value, expected `=`

Codex desktop repeatedly reported:

Request failed ... method=config/read ...
failed to read configuration layers:
C:\Users\Administrator\.codex\config.toml:1:4147: key with no value, expected `=`

The message says "using defaults", but the clients continued calling config/read and never recovered or displayed an actionable error.

Workaround
Copy-Item "$env:USERPROFILE\.codex\config.toml" `
  "$env:USERPROFILE\.codex\config.toml.corrupt.bak"

[IO.File]::WriteAllText(
  "$env:USERPROFILE\.codex\config.toml",
  '',
  (New-Object Text.UTF8Encoding($false))
)

After restarting Codex and reloading VS Code, both clients worked again.

Expected behavior
  • Configuration writes should use a crash-safe atomic replacement strategy and preserve a last-known-good copy.
  • A truncated or zero-filled configuration should be detected during startup.
  • Codex should quarantine the corrupted file and actually continue with defaults, or show an actionable recovery dialog.
  • A malformed shared config should not leave both desktop and IDE surfaces hanging indefinitely.
  • Repair/reset/reinstall flows should detect or clearly report corruption in shared ~/.codex state.
Impact

Because desktop and IDE surfaces share ~/.codex/config.toml, a single interrupted write can disable both clients. The current splash-screen symptom gives no indication that the shared configuration is the cause, making common recovery steps ineffective.

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.