-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Codex intermittently segfaults when starting pytest in Conda env, while same repo/tests work in user terminal and Cursor #14723
Description
Title: Codex intermittently segfaults when starting pytest in Conda env, while same repo/tests work in user terminal and Cursor
Product: Codex desktop app / Codex coding agent runner
Date/time: March 14, 2026, America/Los_Angeles
OS: macOS
Repo: /Users/guido/dev/cerbex/CBE_P
Issue:
Codex intermittently fails to validate unit tests in a Conda environment. In this repo, pytest startup sometimes exits with Segmentation fault: 11 under Codex, even when following the repo’s required Conda workflow exactly. The same commands work for the user in their own terminal and have also worked in some other Codex/Cursor sessions, so this appears intermittent and runner-specific.
Expected behavior:
Codex should be able to activate the existing Conda env and run pytest reliably, or at minimum fail with a normal Python/test error rather than a segfault.
Actual behavior:
Inside Codex, after:
cd /Users/guido/dev/cerbex/CBE_Psource /Users/guido/anaconda3/etc/profile.d/conda.shconda activate CBE_Ppytest tests/unit/api/test_hotel_websocket.py -q
pytest sometimes crashes immediately with:
Segmentation fault: 11
Additional observations:
python -c "import pytest; print(pytest.__version__)"succeeds in the same activated env.python -m pytest --versioncan segfault under Codex.- The same repo and env work from the user’s terminal outside Codex.
- Some Codex sessions succeed; others fail, so the issue appears intermittent.
- We explicitly ruled out command drift:
- no
.venv - no
poetry run pytest - no
conda run - persistent PTY shell used
- no
- Repo docs were updated to standardize this flow, but the segfault still occurs in some Codex sessions.
Why this matters:
The agent can write tests but cannot always validate them, which makes unit-test tasks unreliable in Conda-based repos.
Artifacts available:
- conversation transcript showing repeated segfaults in Codex
- repo-local instructions used by the agent
- exact commands above