Skip to content

OpenAI Codex fails to initialize when Positron is started from the Linux desktop launcher but works when started through /usr/bin/positron on Ubuntu 26.04 LTS #14889

Closed

Description

@chemometrician

System details

Positron and OS details

Positron 2026.07.1

Also reproduced with Positron 2026.06.1.

Operating system:

  • Ubuntu 26.04 LTS
  • KDE Plasma
  • Wayland
  • x86_64

Extension:

  • openai.chatgpt 26.707.71524

Continue is not installed.


Session details

The Codex extension is installed and authenticated.

The Codex backend process starts successfully, but the Codex panel remains stuck on the OpenAI logo.

The codex process is running normally.


Describe the issue

Codex fails to initialize when Positron is started from the desktop launcher.

However, starting Positron via /usr/bin/positron makes Codex initialize correctly.

The problem can be reproduced repeatedly by switching only the launch method.

The problem appeared only recently. I had been using Positron and the OpenAI Codex extension previously without this behavior. I noticed it after recent updates of Positron and/or the OpenAI extension, although I cannot determine which update introduced the regression.


Steps to reproduce

  1. Install Positron on Ubuntu 26.04.
  2. Install the OpenAI Codex extension.
  3. Start Positron from the desktop launcher (gtk-launch positron or the KDE application launcher).
  4. Open the Codex panel.

Observed:

Codex remains stuck on the OpenAI logo.

Then modify the launcher from

Exec=/usr/share/positron/positron %F

to

Exec=/usr/bin/positron %F

Restart Positron.

Codex now initializes correctly.

The behaviour is reproducible by switching between these two launcher commands.


Expected behavior

Codex should initialize correctly regardless of whether Positron is started from the desktop launcher or from the command line.


Additional information

Developer Tools report errors such as:

ElectronWebviewElement.loadResource(...)
potential listener LEAK detected
Failed to load resource: net::ERR_FAILED
The FetchEvent returned a network error response: insufficient resources

Linux resource limits are normal:

  • Max open files: 524288
  • Positron process: ~165 open file descriptors
  • Codex process: ~52 open file descriptors

The /usr/bin/positron wrapper executes:

ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"

whereas the desktop launcher starts

/usr/share/positron/positron

directly.

I do not know whether this difference is expected, but changing the launcher to use /usr/bin/positron completely resolves the issue on my system.

Activity

  1. changed the title [-]OpenAI Codex fails to initialize when Positron is started from the Linux desktop launcher but works when started through /usr/bin/positron[/-] [+]OpenAI Codex fails to initialize when Positron is started from the Linux desktop launcher but works when started through /usr/bin/positron on Ubuntu 26.04 LTS[/+] on Jul 15, 2026
  2. juliasilge commented on Jul 16, 2026

    @juliasilge
    Member

    Thanks for the detailed report, especially for narrowing it down to the launch method. That distinction is really useful and points at a specific mechanism.

    The two launch paths give Positron a different process environment. The desktop launcher runs the raw Electron binary (/usr/share/positron/positron), and in that case Positron spawns your login shell and merges its environment (from ~/.bashrc, ~/.zshrc, ~/.profile, etc.) into the app, including into extension host and webviews. The /usr/bin/positron wrapper instead launches through the CLI, which sets VSCODE_CLI=1 and causes Positron to skip that shell-environment resolution and keep the clean desktop-session environment. So the Codex panel works only on the path that does not pull in your login-shell environment.

    The webview errors you're seeing (FetchEvent returned a network error response: insufficient resources and net::ERR_FAILED on loadResource) are the Codex webview's internal resource loading failing. The usual cause of that kind of failure, gated on which environment the app inherited, is a proxy or CA-related variable coming from your shell profile: HTTP_PROXY / HTTPS_PROXY / NO_PROXY, or NODE_EXTRA_CA_CERTS / NODE_OPTIONS.

    Could you help us confirm which variable is responsible? A couple of things that would pin it down:

    1. With Positron started from the desktop launcher (the failing case), run this and paste the output:

      cat /proc/$(pgrep -f 'positron.*--type=renderer' | head -1)/environ | tr '\0' '\n' | grep -iE 'proxy|node_options|node_extra_ca|npm_config'

      Then do the same with Positron started via /usr/bin/positron (the working case) and paste that too, so we can see the difference.

    2. If you're comfortable sharing it, the relevant lines from your shell profile that set any of those variables would help.

    As a quick check on the theory, if you launch the desktop entry with --force-disable-user-env (edit the launcher Exec to /usr/share/positron/positron --force-disable-user-env %F), does Codex initialize correctly? That flag tells Positron to skip the login-shell environment entirely, so if it fixes things it confirms the problem is a variable coming from your shell profile.

  3. added
    info needed
    on Jul 16, 2026
  4. chemometrician commented on Jul 17, 2026

    @chemometrician
    Author

    Thanks for your explanation. I carried out the tests you suggested.

    After fully exiting Positron between each test, I obtained the following results:

    • /usr/share/positron/positron: Codex worked 2 times out of 10.
    • /usr/share/positron/positron --force-disable-user-env: Codex worked 3 times out of 10.
    • /usr/bin/positron: Codex worked 10 times out of 10.

    So, on my machine, --force-disable-user-env does not make Codex start reliably. The /usr/bin/positron launcher is the only one that has worked consistently so far.

    I could not run the exact renderer command you provided because:

    pgrep -f 'positron.*--type=renderer'

    returns no PID on my system.

    I therefore checked the environment of the main Positron process instead.

    With /usr/share/positron/positron, the command returned nothing.

    With /usr/bin/positron, it returned only:

    VSCODE_CLI=1

    I did not find any matching proxy, Node options, custom CA, or npm configuration variable in either case.

    Please let me know if there is another process or command you would like me to inspect.

  5. juliasilge commented on Jul 17, 2026

    @juliasilge
    Member

    Thank you for the careful comparison. The results actually point away from my original theory, because --force-disable-user-env skips the shell-environment resolution just like the /usr/bin/positron path does, yet only the CLI path is reliable, so an inherited shell variable is not the cause. The intermittent pattern (2/10, 3/10, 10/10) plus the insufficient resources and net::ERR_FAILED errors look instead like a startup race in the webview resource loader.

    From what I can tell, this does not appear to be specific to Positron. The same symptom is reported against stock VS Code on Ubuntu 26.04 with the Codex extension, with an identical fingerprint (the climbing "listener LEAK detected" count, then insufficient resources and net::ERR_FAILED on local webview assets):

    Seems like this is not something specific that Positron is doing. Two things that would help confirm and possibly resolve it for you:

    1. Does the same stuck-on-logo behavior happen if you install the Codex extension in regular VS Code on this machine? If so, that confirms the upstream origin.
    2. Panel stuck on the logo after an in-place extension update: stale VS Code webview service-worker cache (root cause + workaround; likely explains #15975 / #28280 / #32388) openai/codex#33032 describes a service-worker cache workaround. Since you mentioned this started after an update, fully quitting Positron and clearing the webview cache may help. Would you like to give that a try?
  6. chemometrician commented on Jul 17, 2026

    @chemometrician
    Author

    Thank you. I have now reproduced the same issue in regular VS Code using a clean temporary profile containing only the Codex extension.

    Both launch methods used exactly the same directories:

    --user-data-dir /tmp/vscode-codex-test/data
    --extensions-dir /tmp/vscode-codex-test/extensions

    Results:

    • /usr/bin/code:
      Codex initialized successfully 10 times out of 10.

    • /usr/share/code/code:
      Codex initialized successfully only 3 times out of 10.

    The failures show the same symptoms as in Positron: the Codex panel remains stuck and the local webview resources fail to load.

    This confirms that the problem is reproducible in stock VS Code on the same Ubuntu 26.04 machine and is not specific to Positron. It also reproduces the same distinction between the CLI wrapper and the raw Electron binary:

    • CLI launch is reliable.
    • Direct binary launch is intermittent.

    For Positron, launching it through /usr/bin/positron has initialized Codex successfully in all my repeated tests, so I now have a reliable workaround.

    For my own use, this workaround is sufficient. I would prefer not to clear the Positron webview cache unless that additional test would still be useful for diagnosing the upstream issue.

  7. juliasilge commented on Jul 17, 2026

    @juliasilge
    Member

    No need from our end! Let us know if you have further questions 🙌

  8. locked as resolved and limited conversation to collaborators on Aug 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    info needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions