You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Codex CLI becomes unusable if the working directory from which it was launched is moved or removed #2252
If you run codex from WSL in a directory such as C:\FOO\BAR\ and while inside the Codex CLI session C:\FOO\BAR\ is moved to C:\FOO\BLAH\ all future executions fail with "No such file or directory (os error 2)". Codex CLI seemed unable to cwd or execute other tricks to recover, and has to terminate to be usable again.
What is the expected behavior?
Either refuse to delete/move/etc the CWD from codex's launch, or ideally just handle it gracefully somehow. Sorry, not sure on a specific fix approach, but it definitely confused me for far too long tonight.
changed the title [-]Codex CLI becomes unusable if the working directory it was launched from is moved or removed[/-][+]Codex CLI becomes unusable if the working directory from which it was launched is moved or removed[/+]on Aug 13, 2025
For me it's randomly having a crashout now and then. Sometimes relaunch help, other times it persists. It narrows down to it trying to launch python3 and getting os error 2 "file does not exist". It got so confused it tried to check python's version, which worked, and then tried to print something in console with smth like python3 -c "print(1);print(2)", which resulted in os error, which confused the model even further. Heck it confused me too. I suspect there's something about container or whatnot, i didn't check codex's source code, but it seems that inner container is not working properly maybe. I'm on WSL2 btw. Maybe it cd'd to some temp directory, it got deleted and python tries to set up its workdir to deleted directory, which results in this? Model for sure did some cd's, but didn't see any rm or mkdir, and task was about reading the files and describing them.
Activity
[-]Codex CLI becomes unusable if the working directory it was launched from is moved or removed[/-][+]Codex CLI becomes unusable if the working directory from which it was launched is moved or removed[/+]techjoec commentedon Aug 13, 2025
Actually - might be something else. I will update but relaunch only worked for a very short period.
techjoec commentedon Aug 13, 2025
Yeah I dont know what the heck blew up. I did some reinstalls of codex and other frantic packages and it seems ok..
kvcop commentedon Oct 3, 2025
For me it's randomly having a crashout now and then. Sometimes relaunch help, other times it persists. It narrows down to it trying to launch python3 and getting os error 2 "file does not exist". It got so confused it tried to check python's version, which worked, and then tried to print something in console with smth like
python3 -c "print(1);print(2)", which resulted in os error, which confused the model even further. Heck it confused me too. I suspect there's something about container or whatnot, i didn't check codex's source code, but it seems that inner container is not working properly maybe. I'm on WSL2 btw. Maybe it cd'd to some temp directory, it got deleted and python tries to set up its workdir to deleted directory, which results in this? Model for sure did some cd's, but didn't see any rm or mkdir, and task was about reading the files and describing them.