codex icon indicating copy to clipboard operation
codex copied to clipboard

Windows: bundled rg in Codex Desktop resolves on PATH but fails with Access Denied in integrated PowerShell

Open neavo opened this issue 9 months ago • 37 comments

What happened?

In Codex Desktop on Windows, rg resolves to the bundled binary under the app package directory:

C:\Program Files\WindowsApps\OpenAI.Codex_...\app\resources\rg.exe

But invoking rg from the integrated PowerShell 7 terminal fails with Access Denied.

Reproduction steps

  1. Open Codex Desktop integrated terminal (PowerShell 7).
  2. Run:
    • Get-Command rg -All
    • rg --version
  3. Observe that rg points to the bundled path and execution fails.

Actual result

rg --version fails with an error similar to:

Program 'rg.exe' failed to run ... Access is denied.

Also, another executable in the same folder (codex-command-runner.exe) fails with the same access-denied error when launched from terminal context.

Expected result

If bundled rg is exposed on PATH, it should be executable from the integrated terminal.

Additional diagnostics

  • The bundled rg.exe file is readable and hashable.
  • Copying the same binary to %TEMP% and running it works (ripgrep 15.1.0), suggesting the issue is path/package execution policy rather than binary corruption.
  • ACL/SDDL for files under the package path appears to include app-identity-conditioned entries (WindowsApps package restrictions).

Workaround

Putting Git's rg.exe earlier in PATH works:

C:\Program Files\Git\usr\bin\rg.exe

After PATH update, rg --version succeeds in the same terminal.

Environment

  • OS: Windows (user environment)
  • Terminal: PowerShell 7.5.4 (PSEdition=Core)
  • Codex Desktop package path observed: C:\Program Files\WindowsApps\OpenAI.Codex_26.304.1528.0_x64__2p2nqsd0c76g0\app\resources

neavo avatar Mar 05 '26 06:03 neavo

Potential duplicates detected. Please review them and close your issue if it is a duplicate.

  • #10090
  • #9062

Powered by Codex Action

github-actions[bot] avatar Mar 05 '26 06:03 github-actions[bot]

Is there any official response to this issue? Codex Windows app is unusable right now

azarenkova-git avatar Mar 05 '26 23:03 azarenkova-git

@azarenkova-git, just to confirm, this occurs when you attempt to invoke rg manually from within the app's built-in terminal? If so, why is that blocking you from using Codex Windows?

etraut-openai avatar Mar 06 '26 00:03 etraut-openai

@etraut-openai Codex gives me the error that rg is not usable in this shell and falls back to PowerShell file search. Meanwhile, it works just fine in the VS Code extension. The rg bundled with the app is stored in C:/Program Files/WindowsApps which it is not able to access.

schardeinmechanical avatar Mar 06 '26 12:03 schardeinmechanical

Can confirm

rg -n "GameThreadWaitForTask|STAT_GameIdleTime|Frame Sync Time|FrameEndSync|FFrameEndSync|Sync\(" Engine/Source/Runtime/RenderCore/Private/RenderingThread.cpp
ResourceUnavailable: 
Line |
   2 |  rg -n "GameThreadWaitForTask|STAT_GameIdleTime|Frame Sync Time|FrameE …
     |  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     | Program 'rg.exe' failed to run: An error occurred trying to start process 'C:\Program Files\WindowsApps\OpenAI.Codex_26.311.2262.0_x64__2p2nqsd0c76g0\app\resources\rg.exe' with working directory 'D:\unrealengine5'. 拒绝访问。At line:2 char:1
+ rg -n "GameThreadWaitForTask|STAT_GameIdleTime|Frame Sync Time|FrameE …
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~.

jsjtxietian avatar Mar 13 '26 03:03 jsjtxietian

error occurs while agent using rg.exe, just like apply_patch, they're no permission to execute

xxxifan avatar Mar 13 '26 09:03 xxxifan

I hit the same issue and wanted to share what happened on my machine.

Environment:

  • Codex Desktop on Windows
  • rg initially resolved to the bundled binary under C:\Program Files\WindowsApps\OpenAI.Codex_...\app\resources\rg.exe
  • Running rg --version failed with Access is denied

What worked for me:

  1. Installed ripgrep separately with: winget install --id BurntSushi.ripgrep.MSVC -e
  2. In the current shell, the newly installed rg.exe could be invoked directly by full path.
  3. However, fresh Codex shell sessions still picked the bundled WindowsApps rg at first.
  4. After restarting the Codex app, PATH was refreshed correctly and rg started resolving to the winget-installed binary instead of the bundled one.

So on my side, the practical fix was:

  • install ripgrep separately
  • restart Codex Desktop so the new PATH is picked up cleanly

That was enough; no permanent wrapper was needed in the end.

seunghyeok2915 avatar Mar 19 '26 06:03 seunghyeok2915

I had a similar issue with the same error message, I'm not sure if it had the same source though. I was able to fix it by adding the following to the custom instructions in the settings:

  • When running shell commands on Windows, normalize workdir by stripping a leading \?\ prefix before execution.

flavio-marchi-exxas avatar Mar 19 '26 07:03 flavio-marchi-exxas

I hit the same issue and wanted to share what happened on my machine.

Environment:

* Codex Desktop on Windows

* `rg` initially resolved to the bundled binary under `C:\Program Files\WindowsApps\OpenAI.Codex_...\app\resources\rg.exe`

* Running `rg --version` failed with `Access is denied`

What worked for me:

1. Installed ripgrep separately with:
   `winget install --id BurntSushi.ripgrep.MSVC -e`

2. In the current shell, the newly installed `rg.exe` could be invoked directly by full path.

3. However, fresh Codex shell sessions still picked the bundled WindowsApps `rg` at first.

4. After restarting the Codex app, PATH was refreshed correctly and `rg` started resolving to the winget-installed binary instead of the bundled one.

So on my side, the practical fix was:

* install ripgrep separately

* restart Codex Desktop so the new PATH is picked up cleanly

That was enough; no permanent wrapper was needed in the end.

I can confirm that. I had the same problem (on two computers), and this solution worked right away.

bellerG avatar Apr 04 '26 15:04 bellerG

I can also confirm that.

Image

albayazid avatar Apr 06 '26 15:04 albayazid

Setting the PATH variable didn't work for me. But giving my user full access to the "resources" folder did the trick. In my case, this is

C:\Program Files\WindowsApps\OpenAI.Codex_26.325.3894.0_x64__2p2nqsd0c76g0\app\resources

vikmanza avatar Apr 08 '26 12:04 vikmanza

I also get this very frequently, Codex falls back to PowerShell search.

RehaInce avatar Apr 08 '26 14:04 RehaInce

I also get this very frequently, Codex falls back to PowerShell search.

You should really force it to use rg it is a much much smoother experience. make sure its installed and in path ects.

i also added a line in the always promt use rg becouse else it wil sometimes not try that first, i think becouse somewhere its remembering that its not working or whatever.

NicTanghe avatar Apr 08 '26 20:04 NicTanghe

I told codex to copy rg to apply_patch path, just working. some other PATH should work as well.

xxxifan avatar Apr 09 '26 02:04 xxxifan

Image

Osanosa avatar Apr 18 '26 10:04 Osanosa

I also get this very frequently, Codex falls back to PowerShell search.

I get it whenever I start a session lol. What is OpenAI doing?

albayazid avatar Apr 18 '26 17:04 albayazid

They're vibe coding.

On the other note, for me, administrative sandbox failed to set up and even though I had given full access this is still happening

On Sat, 18 Apr 2026, 20:16 Sazid Al Bayazid @.***> wrote:

albayazid left a comment (openai/codex#13542) https://github.com/openai/codex/issues/13542#issuecomment-4274199652

I also get this very frequently, Codex falls back to PowerShell search.

I get it whenever I start a session lol. What is OpenAI doing?

— Reply to this email directly, view it on GitHub https://github.com/openai/codex/issues/13542?email_source=notifications&email_token=ATD6MCHPYNNJ5GOGEIYVDA34WOZ6JA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTIMRXGQYTSOJWGUZKM4TFMFZW63VHMNXW23LFNZ2KKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-4274199652, or unsubscribe https://github.com/notifications/unsubscribe-auth/ATD6MCBLYGFWVWOZRNHR2VD4WOZ6JAVCNFSM6AAAAACWHRINOSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHM2DENZUGE4TSNRVGI . You are receiving this because you commented.Message ID: @.***>

Osanosa avatar Apr 18 '26 18:04 Osanosa

I the same problem in both the VS Code extension and the stand-alone Codex app. Every conversation starts with this error.

Installing RipGrep separately does not work around for me:

Codex, please run rg with --version for testing purposes

rg --version did not run successfully here.

PowerShell resolves rg to: C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Links\rg.exe

That path is a symbolic link to: C:\Users\REDACTED\AppData\Local\Microsoft\WinGet\Packages\BurntSushi.ripgrep.MSVC_Microsoft.Winget.Source_8wekyb3d8bbwe\ripgrep-15.1.0-x86_64-pc-windows-msvc\rg.exe

What happened:

Invoking rg via the WinGet link failed with: No application is associated with the specified file for this operation Invoking the real binary directly failed with: Access is denied

I can run 'rg' fine from a PowerShell myself.

ryancu7 avatar Apr 21 '26 07:04 ryancu7

This is still an on going issue it seems and still exists

Iydah avatar Apr 23 '26 06:04 Iydah

It very much is

RvanZuilichem avatar Apr 23 '26 09:04 RvanZuilichem