openai / openai/codex

[macOS][ChatGPT Desktop] Upgrade silently launches with 0 windows when ~/.codex is a file (ENOTDIR ~/.codex/sqlite)

Open
#41,367 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

app bug
Dominant language
Rust
Stars
125k
Forks
19.4k
PR merge metrics
PR metrics pending

Description

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

ChatGPT Desktop 26.825.32147 (build 7303)

What subscription do you have?

ChatGPT Plus

What platform is your computer?
macOS 26.5.2 (25F84)
Apple Silicon (arm64)
What issue are you seeing?

After the previous macOS app prompted me to update, I downloaded the new DMG and installed it over the existing app. ChatGPT then launched as a process and appeared in the macOS menu bar, but it never created an application window.

macOS reported zero windows:

osascript -e 'tell application "System Events" to tell process "ChatGPT" to count windows'
0

The main process remained alive at approximately 0% CPU. Chromium GPU, network, and storage service processes were running, but there was no renderer process or codex app-server.

Launching the binary directly from Terminal exposed the startup failure:

"/Applications/ChatGPT.app/Contents/MacOS/ChatGPT"
This error originated either by throwing inside of an async function without a catch block,
or by rejecting a promise which was not handled with .catch().

Error: ENOTDIR: not a directory, stat '/Users/<user>/.codex/sqlite'

Inspection showed that ~/.codex was a pre-existing regular ASCII text file rather than a directory:

ls -ld "$HOME/.codex"
file "$HOME/.codex"
-rw-r--r--  1 <user>  staff  43 Jan 18 2025 /Users/<user>/.codex
/Users/<user>/.codex: ASCII text, with no line terminators

Because ~/.codex was a file, the app could not stat or create ~/.codex/sqlite. The rejected promise appears to stop startup before the BrowserWindow/renderer is created, leaving the app silently running with zero windows.

The contents of the legacy file are intentionally omitted.

What steps can reproduce the bug?
  1. Start with a macOS user profile where ~/.codex already exists as a regular file, not a directory.
  2. Upgrade/install ChatGPT Desktop 26.825.32147 from the DMG.
  3. Launch ChatGPT.
  4. Observe that the app process and menu-bar entry appear, but no window is created.
  5. Launch the executable from Terminal and observe ENOTDIR: not a directory, stat '/Users/<user>/.codex/sqlite'.
Workaround

Renaming the legacy file and creating the expected directory immediately fixed the problem:

killall ChatGPT 2>/dev/null
mv "$HOME/.codex" "$HOME/.codex.legacy-file"
mkdir -p "$HOME/.codex/sqlite"
chmod 700 "$HOME/.codex" "$HOME/.codex/sqlite"
open -a ChatGPT

ChatGPT then launched normally and created a window.

What is the expected behavior?

During startup or upgrade migration, the desktop app should check whether ~/.codex exists and whether it is a directory.

If it exists as a file, the app should either:

  • safely migrate/rename the legacy file, or
  • show an actionable error explaining the conflict.

An unhandled ENOTDIR rejection should not leave the app silently running with zero windows.

Additional information

This appears related to #10607, which reported the same ENOTDIR condition in an earlier Codex Desktop build. That issue was closed as completed, but the current unified ChatGPT Desktop build reproduces the path-type conflict with a different and less visible failure mode: the old report showed a JavaScript error dialog, while this build remains running with zero windows.

#31208 also reports zero windows on macOS, but appears different: in that report renderers and app-server are running, whereas in this reproduction startup stops earlier and the ENOTDIR error identifies a concrete filesystem precondition.

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 startup path by launching /Applications/ChatGPT.app/Contents/MacOS/ChatGPT with ~/.codex as a regular file, then trace the initialization that accesses ~/.codex/sqlite. Done means the app either safely handles or clearly reports the path conflict and does not remain running with zero windows after an unhandled ENOTDIR rejection.

Written by the indexing model from the issue text.

Assessment

Tech stack
macos
Domain
desktop-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.