Codex VS Code extension hangs when VS Code is launched via /usr/share/code/code, but works via /usr/bin/code

Resolved 💬 1 comment Opened Jul 22, 2026 by ilnblue Closed Jul 22, 2026
💡 Likely answer: A maintainer (github-actions[bot], contributor) responded on this thread — see the highlighted reply below.

What version of the IDE extension are you using?

26.715.61943

What subscription do you have?

ChatGPT Plus

Which IDE are you using?

VS Code

What platform is your computer?

_No response_

What issue are you seeing?

The Codex VS Code extension hangs indefinitely on its loading logo when VS Code is launched from the Linux desktop application menu.

I isolated the problem to the VS Code launch path:

  • Launching VS Code with /usr/share/code/code /path/to/workspace reproduces the issue.
  • Launching the same VS Code installation with /usr/bin/code /path/to/workspace works correctly.
  • Running /usr/bin/code with the same restricted PATH used by the desktop session also works, so this does not appear to be caused by PATH, Node.js, NVM, or other shell environment variables.
  • The same Codex extension version, user-data directory, extensions, workspace, and authentication are used in both cases.

During a failed launch, the Codex log stops after:

[CodexMcpConnection] Initialize received id=1

During a successful launch, it continues with messages such as:

React root render requested
app routes mounted
ready provider mounted

The workaround is to create a user-level desktop entry at:

~/.local/share/applications/code.desktop

and change its Exec entries from:

Exec=/usr/share/code/code %F

to:

Exec=/usr/bin/code %F

After updating the desktop database and launching VS Code through the modified desktop entry, the Codex extension loads normally across repeated launches.

This appears to be a difference between launching VS Code directly through the Electron binary and launching it through the VS Code CLI wrapper.

What steps can reproduce the bug?

  1. Install Visual Studio Code and the OpenAI Codex extension on Linux.
  1. Confirm that the system desktop entry launches VS Code directly. For example:

grep '^Exec=' /usr/share/applications/code.desktop

The result includes:

Exec=/usr/share/code/code %F

  1. Completely close all VS Code windows and confirm that no VS Code processes remain.
  1. Launch VS Code from the desktop application menu or pinned dock icon.
  1. Open the Codex sidebar.
  1. Observe that the Codex extension remains indefinitely on the loading logo. Its log stops after:

[CodexMcpConnection] Initialize received id=1

  1. Completely close VS Code again.
  1. Launch the same installation, workspace, user-data, extensions, and Codex account from a terminal:

/usr/bin/code /path/to/workspace

  1. Open the Codex sidebar and observe that it loads normally. The log continues with:

React root render requested
app routes mounted
ready provider mounted

  1. To reproduce the failing launch without using the desktop menu, completely close VS Code and run:

/usr/share/code/code /path/to/workspace

The Codex extension hangs on the loading logo again.

  1. As a workaround, copy the desktop entry to the user application directory and replace the executable:

mkdir -p ~/.local/share/applications
cp /usr/share/applications/code.desktop ~/.local/share/applications/code.desktop
sed -i 's|Exec=/usr/share/code/code|Exec=/usr/bin/code|g' ~/.local/share/applications/code.desktop
update-desktop-database ~/.local/share/applications

  1. Launch VS Code from the modified desktop entry. The Codex extension now loads normally across repeated launches.

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

1 Comment

github-actions[bot] contributor · 1 month ago

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

  • #34308

Powered by Codex Action