Refactor workflow drifted into cross-language rewrite that corrupted Python
Resolved 💬 2 comments Opened Apr 2, 2026 by j32097072 Closed Apr 2, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor)
responded on this thread — see the highlighted reply below.
What version of Codex CLI is running?
codex-cli 0.114.0
What subscription do you have?
api call
Which model were you using?
gpt 4o mini
What platform is your computer?
Linux 6.6.87.2-microsoft-standard-WSL2 x86_64 x86_64
What terminal emulator and version are you using (if applicable)?
WSL
What issue are you seeing?
The run drifted from bounded readability refactoring into a cross-language style rewrite inside Python test code, producing repository mutations that were syntactically invalid and not recovery-safe.
What steps can reproduce the bug?
- Open a repository-backed workspace.
- Ask Codex CLI to perform the requested edit, repair, or cleanup workflow reflected by this report.
- Observe whether it reproduces the failure described above.
What is the expected behavior?
Codex CLI should either apply a valid change or fail cleanly. It should not corrupt repository state, write invalid syntax, or perform over-broad filesystem actions.
2 Comments
The repository is currently clean:
git status, git diff, and targeted diffs under sdk/python/tests/ sdk/python/srcall show no changes. python3 -m compileall …and an AST scan across the Python SDK/tests also pass, and HEADmatches the last known good commit.The earlier Codex refactor did inject invalid Python and cross‑language churn, but rerunning it in a clean tree leaves no persistent damage — the bad mutations only exist transiently and are cleared by resetting the tree.
That said, the workflow still feels risky because the refactor can wander into unrelated language layers and write unsafe edits. For reproduction / mitigation, it may help to:
git reset --hard HEADor returning to the prior clean commit removes the corruption, so the repo itself isn’t permanently damaged, but the intermediate state is potentially destructive.Thanks for the bug report. We'll share the feedback with the team responsible for training our codex models. If you see other model behavior that you'd like to report, please use the
/feedbackcommand. That will provide us with additional details including logs and conversation text.