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
prepend_path_entry_for_apply_patch mangles $PATH and interferes with python virtualenv behavior #5225
The title. This is bad behavior! Don't go willy nilly screwing with user paths (or any environment vars, for that matter) - they get exported and we expect programs to respect their configured behavior.
What steps can reproduce the bug?
Try to have codex call python from within a virtual environment.
Try !echo $PATH | tr ':' '\n' from inside the codex prompt and see what shows up, vs when you call it in your shell.
If you manually instruct codex to use the full path, it'll run the correct python and access all your dependencies just fine.
What is the expected behavior?
Codex should just be able to call python without having to specify the full path. Defeats the purpose of a virtualenv otherwise :)
Additional information
The fundamental issue is architectural: prepend_path_entry_for_apply_patch modifies the global process environment at the very start of arg0_dispatch_or_else, before the Tokio runtime is even created. This modified environment becomes the baseline for all subsequent operations, including:
Configuration loading
Subprocess spawning
Shell profile sourcing
So no, there are no configuration solutions to bypass this issue.
Activity
github-actions commentedon Oct 15, 2025
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
Powered by Codex Action
fix(windows-path): preserve PATH order; include core env vars (#5579)
fix(windows-path): preserve PATH order; include core env vars (openai…
fix(windows-path): preserve PATH order; include core env vars (openai…
fix(windows-path): preserve PATH order; include core env vars (openai…
etraut-openai commentedon Jan 10, 2026
Closing old issue.