Skip to content

Open in VS Code silently fails on Windows when VS Code is configured to run as administrator #19800

@wesias7

Description

@wesias7

What version of the Codex App are you using (From “About Codex” dialog)?

Codex App 26.422.3464.0 codex-cli 0.121.0

What subscription do you have?

Pro

What platform is your computer?

Microsoft Windows NT 10.0.26100.0 x64

What issue are you seeing?

Environment:

  • Windows
  • Codex desktop app
  • VS Code installed at user-level path:
    C:\Users\user\AppData\Local\Programs\Microsoft VS Code\Code.exe

Observed:
Clicking “Open in VS Code” from the project header does nothing. No toast, dialog, or visible error is shown.

Log:

spawn C:\Users\user\AppData\Local\Programs\Microsoft VS Code\Code.exe EACCES


### What steps can reproduce the bug?

1. On Windows, install VS Code in the default user-level location:
   `C:\Users\<user>\AppData\Local\Programs\Microsoft VS Code\Code.exe`

2. Open the VS Code executable properties.

3. Enable:
   Compatibility > Run this program as an administrator

4. Start the Codex desktop app normally, not as administrator.

5. Open any project in Codex.

6. Click the “Open in VS Code” button in the project header.

7. Observe that nothing visible happens in the UI.

8. Check the Codex desktop logs and observe an `EACCES` error when spawning `Code.exe`.

In my case, disabling “Run this program as an administrator” on VS Code immediately fixed the issue.

### What is the expected behavior?

Codex should not fail silently when “Open in VS Code” cannot launch VS Code.

Expected behavior:
- If launching VS Code succeeds, open the project in VS Code.
- If launching VS Code fails with `EACCES`, show a visible toast/dialog explaining that Windows denied launching VS Code.
- The message should suggest checking whether VS Code is configured to run as administrator, or whether Codex and VS Code are running with mismatched privilege levels.

Example message:
“Could not open VS Code. Windows denied the launch request. VS Code may be configured to always run as administrator. Disable ‘Run this program as an administrator’ for VS Code, or run Codex with matching privileges.”


### Additional information

This was local-machine specific. The same Codex workflow worked on another laptop.

VS Code itself was installed correctly:
- `code` was available on PATH.
- `vscode://` protocol was registered.
- Running `code <project-path>` manually from PowerShell opened the project successfully.

The issue was only with Codex launching VS Code from the desktop app button while VS Code was configured to always run as administrator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    appIssues related to the Codex desktop appbugSomething isn't workingwindows-osIssues related to Codex on Windows systems

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions