Codex can't run echo $env:PATH
What version of Codex CLI is running?
codex-cli 0.111.0
What subscription do you have?
Plus
Which model were you using?
gpt-5.4
What platform is your computer?
_No response_
What terminal emulator and version are you using (if applicable)?
Microsoft Windows NT 10.0.26200.0 x64
What issue are you seeing?
I just asked a basic question about my environment and all commands it tried seemed to fail, even down to the simplest echo $env:PATH.
What steps can reproduce the bug?
Uploaded thread: 019ccff6-be83-7ab1-a4a2-226f010ae5bb
What is the expected behavior?
Not only should these not fail, but they shouldn't hang if they don't work.
A human knows that if they run echo $env:PATH it will almost certainly be done in a second, and if it isn't, a human is smart enough to know that something fishy is going on and thus abort the attempt. AI should be able to as well. If the harness said to the LLM "hey you ran echo $env:PATH 10 seconds ago and it hasn't returned yet, you wanna wait or kill it?" I'm pretty sure you'd get a smart answer out of the LLM.
With any attempt at running a command, the LLM could provide a 'check-in' time. Not quite a timeout, but an opportunity to decide whether to wait another n seconds or kill it and try something else (perhaps with partial results if the command results in some stream of output).
Additional information
_No response_
4 Comments
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
Those related issues look vaguely similar but different to this. I don't see any errors, the commands just hang.
Although I just tried with v0.112 and fails for all sorts of things but doesn't actually hang. I asked "Can you run the simplest command you can to output my path env var?"
And got:
Does it work when tested on Windows internally, is this just me?
I have the same problem.
I verified the patched behavior on native Windows from the same SSH / network-logon path that previously produced empty output and
-1073741502.C:\Users\codyr\.codex0path now returns the targetedWindows restricted-token sandbox cannot launch reliably from this non-interactive or network-logon session until elevated Windows sandbox setup has completed...error withEXIT=1powershell.exe, directdotnet.exe --info, directcmd.exe /c echo ok, directreg.exe query HKCU\Environment, and the childpowershell.exe/dotnet.exe/whoami /groupscommands through sandboxedcmd.exelegacy sandbox: session_id=0 interactive=false remote_interactive=false network=true -> elevated setup requiredThe old SSH / network-logon failure mode is no longer reproducing on this host.
The guard is firing on the intended legacy restricted-token path and surfacing the setup-missing state directly.
This verifies the non-interactive / network-logon fix path: use the elevated sandbox-user runner when setup exists, or return a targeted setup-required error instead of empty output and
-1073741502.Code patch I validated:
https://github.com/SproutSeeds/codex/commit/8a7b5609b37db1beecbb97a36aae055a832810d0
Full verification branch:
https://github.com/SproutSeeds/codex/tree/sprout/issue-14015-windows-handoff