Codex hangs when VS Code is launched from the desktop launcher (/usr/share/code/code) but works when started with code (/usr/bin/code) on Linux Mint
What version of the IDE extension are you using?
26.707.71524-linux-x64
What subscription do you have?
ChatGPT Plus
Which IDE are you using?
Visual Studio Code 1.128.0
What platform is your computer?
Linux 6.17.0-40-generic x86_64 x86_64
What issue are you seeing?
Codex stays on the loading screen indefinitely when VS Code is started from the desktop launcher (or pinned icon).
However, if I start VS Code from a terminal using:
code
Codex works correctly.
This is reproducible.
What steps can reproduce the bug?
- Install Visual Studio Code from the Microsoft Debian package.
- Install the OpenAI ChatGPT extension (Codex).
- Close VS Code completely.
- Launch VS Code from the desktop launcher (or a panel shortcut) that executes:
Exec=/usr/share/code/code %F
- Open the Codex view.
Result
Codex stays on the loading screen indefinitely.
The Codex output shows:
Activating Codex extension
Spawning codex app-server
Initialize received id=1
- Close VS Code completely.
- Start VS Code from a terminal:
code
- Open the Codex view.
Result
Codex loads and works normally.
What is the expected behavior?
Codex should initialize and work regardless of whether VS Code is started from the desktop launcher or by running code from a terminal.
Additional information
After investigating, I found that the launch method is the only reproducible difference.
The desktop launcher starts VS Code with:
Exec=/usr/share/code/code %F
Running from the terminal uses the standard VS Code wrapper:
code
which resolves to:
/usr/bin/code -> /usr/share/code/bin/code
Changing my desktop launcher to:
Exec=/usr/bin/code %F
makes Codex work reliably.
This suggests there is a difference between launching VS Code through the Electron binary directly and launching it through the standard code wrapper.
I also ruled out:
- corrupted
~/.codex - invalid
config.toml - corrupted VS Code profile
- corrupted extensions directory
- interference from other installed extensions
Developer Tools repeatedly showed calls to loadLocalResource / readFileStream while Codex was stuck loading.
3 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
I reproduced the same issue on Ubuntu with the Codex VS Code extension
26.707.71524-linux-x64.Symptoms
When VS Code is launched from the desktop/pinned launcher, Codex remains on
the loading logo indefinitely. In some cases, the VS Code renderer also
crashes with:
The window terminated unexpectedly
reason: 'crashed'
code: '135'
The desktop launcher was executing:
/usr/share/code/code
When VS Code is launched from a terminal using:
code .
Codex loads successfully.
coderesolves through:/usr/bin/code -> /usr/share/code/bin/code
Diagnostics
The Codex CLI works normally and is authenticated using ChatGPT.
In both the successful and failed cases, the Codex app-server starts and
receives initialization:
Activating Codex extension
Spawning codex app-server
Initialize received id=1
In the failed desktop-launch case, VS Code Developer Tools reports failures
loading local Codex webview assets:
Unable to preload CSS
Failed to load resource: net::ERR_FAILED
potential listener LEAK detected
The stack repeatedly contains:
doReadFileStream
readFileStream
loadResource
Affected URLs use the local VS Code webview resource scheme:
https://file+.vscode-resource.vscode-cdn.net/.../
openai.chatgpt-26.707.71524-linux-x64/webview/assets/...
The failed Codex log never reaches:
React root render requested
[startup][renderer] app routes mounted
When launched using
code ., it does reach those messages and the Codex UIloads successfully.
The following warnings occur in both the successful and failed runs, so they
do not appear to be the direct cause:
failed to refresh available models:
timeout waiting for child process to exit
failed to load recommended plugins:
EOF while parsing a value
Controls performed
I ruled out:
A clean/isolated VS Code process worked, and the same normal profile and
extension directory also worked when VS Code was started using
code ..Workaround
I created a user-level desktop entry and changed its
Execentries from:Exec=/usr/share/code/code ...
to:
Exec=/usr/bin/code ...
After completely terminating all existing VS Code processes and launching
from the updated desktop entry, Codex loads normally.
Commands used:
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
This suggests that launching the Electron binary directly has a different
environment or initialization path from launching through the official
/usr/share/code/bin/codewrapper.The immediate failure occurs in VS Code local Webview asset loading, not in
the Codex app-server or authentication layer.
Confirmed on an independent Fedora setup that routing the desktop entry through the VS Code CLI wrapper resolves this failure.
Environment (sanitized)
openai.chatgpt@26.715.31925Failure signature
When the application launcher used the raw Electron binary:
the Codex app-server started and completed initialization, but the webview did not finish bootstrapping. Developer Tools showed:
net::ERR_FAILEDUnable to preload CSSdoReadFileStream -> readFileStream -> loadResourcestacksThe failed assets were present and readable on disk. Static inspection of this extension build's webview entry showed a startup dependency preload list containing 676 assets, which may explain why this launch-path difference becomes visible as resource/listener pressure.
Only change made
I installed user-level desktop-entry overrides that route both normal launches and URL handling through the wrapper:
I then refreshed the user desktop database, fully quit VS Code, and relaunched it from the application menu.
Codex now initializes normally, and the failure has not recurred during verification. I did not clear caches, reinstall or downgrade the extension, change authentication, change GPU settings, or modify the workspace.
This independently confirms that the workaround applies beyond Debian/Ubuntu and still applies to the newer extension/VS Code versions above. It also connects the launch-path issue here with the webview resource-failure signature in #32530 and the analogous investigation in posit-dev/positron#14889.