Codex VS Code extension hangs when VS Code is launched via /usr/share/code/code, but works via /usr/bin/code
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/workspacereproduces the issue. - Launching the same VS Code installation with
/usr/bin/code /path/to/workspaceworks correctly. - Running
/usr/bin/codewith 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?
- Install Visual Studio Code and the OpenAI Codex extension on Linux.
- 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
- Completely close all VS Code windows and confirm that no VS Code processes remain.
- Launch VS Code from the desktop application menu or pinned dock icon.
- Open the Codex sidebar.
- Observe that the Codex extension remains indefinitely on the loading logo. Its log stops after:
[CodexMcpConnection] Initialize received id=1
- Completely close VS Code again.
- Launch the same installation, workspace, user-data, extensions, and Codex account from a terminal:
/usr/bin/code /path/to/workspace
- Open the Codex sidebar and observe that it loads normally. The log continues with:
React root render requested
app routes mounted
ready provider mounted
- 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.
- 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
- 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_
1 Comment
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action