Windows: "Open with VS Code" fails even when VS Code works normally outside Codex

Open 💬 4 comments Opened Apr 20, 2026 by wendaining

Summary

On Windows, the "Open with VS Code" action in Codex fails even when Visual Studio Code is correctly installed and usable through normal Windows mechanisms.

This does not appear to be a general VS Code installation problem.

Environment

  • OS: Windows 11
  • Codex Desktop: Microsoft Store package
  • Observed in logs as OpenAI.Codex_26.415.4716.0_x64__2p2nqsd0c76g0
  • VS Code:
  • Reproduced first with an older custom-path install
  • Reproduced again after a clean reinstall to the default path:
  • C:\Program Files\Microsoft VS Code\Code.exe

Expected behavior

Clicking "Open with VS Code" in Codex should open the current file/folder/workspace in VS Code.

Actual behavior

Codex fails to open VS Code.

Outside Codex, VS Code works normally:

  • launching manually from File Explorer works
  • code works from the terminal
  • vscode:// works
  • Windows can recognize VS Code in Default Apps

Key finding

Codex appears to launch Code.exe directly and treats the result as a failure because the process exits with code 1.

Relevant log snippets:

Old install path:

2026-04-20T02:06:20.482Z error [electron-fetch-handler] Failed to open file errorMessage="D:\IDEs\Microsoft VS Code\Code.exe exited with code 1 (D:\Alles\hci\hw3)"

Fresh default install:

2026-04-20T03:47:08.571Z error [electron-fetch-handler] Failed to open file errorMessage="C:\Program Files\Microsoft VS Code\Code.exe exited with code 1 (D:\Alles\hci\hw3)"

Another repro with the fresh install:

2026-04-20T03:47:12.962Z error [electron-fetch-handler] Failed to open file errorMessage="C:\Program Files\Microsoft VS Code\Code.exe exited with code 1 (D:\Alles\hci\hw3)"

Troubleshooting already done

I tested and/or fixed the following:

  • reinstalling VS Code
  • installing VS Code to the default path
  • fixing PATH so code works
  • fixing file associations / default app registration
  • fixing vscode://
  • cleaning old VS Code registry remnants from a previous install

These steps improved Windows-level behavior, but did not fix Codex's "Open with VS Code" action.

Why this looks like a Codex bug

The issue seems specific to Codex's launch strategy on Windows:

  • normal Windows / shell / protocol launching works
  • Codex's direct Code.exe launch fails
  • the same failure occurred before and after reinstalling VS Code

That suggests Codex may be relying on a Windows launch path that is too brittle.

Possible fix directions

Instead of invoking Code.exe directly, Codex may need to use a more Windows-friendly launch path, for example:

  • vscode://
  • code / code.cmd
  • a shell-based open flow rather than treating Code.exe as a command-style entry point

If helpful, I can provide more environment details or additional log context.

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗