v0.121.0: apply_patch fails with use_legacy_landlock=true and prompts sandbox retry for workspace edits
Resolved 💬 6 comments Opened Apr 16, 2026 by msublee Closed Apr 17, 2026
What version of Codex CLI is running?
codex-cli 0.121.0
Which model were you using?
gpt-5.4
What platform is your computer?
Linux
What issue are you seeing?
With use_legacy_landlock = true, normal workspace edits regress in 0.121.0.
The edit target is inside the current repository and is readable/writable under the legacy landlock sandbox. Simple shell commands in the sandbox succeed, and direct write smoke tests also succeed. But when Codex goes through the file-change / apply_patch path, it fails before completing the edit through the normal mechanism.
The exact error I reproduced is:
Failed to read file to update /path/to/repo/.codex-smoke.txt: fs sandbox helper failed with status exit status: 101: thread 'main' (...) panicked at linux-sandbox/src/linux_run_main.rs:395:9:
split sandbox policies requiring direct runtime enforcement are incompatible with --use-legacy-landlock
After that, Codex may ask:
Reason: command failed; retry without sandbox?
This seems related to #17674 ("Route apply_patch through the environment filesystem"), which already notes:
approval/retry behavior still need explicit scrutiny for delete/update flows
This looks like a concrete Linux regression for the use_legacy_landlock = true path.
What steps can reproduce the bug?
- Run Codex
0.121.0on Linux in an environment where legacy landlock is required. - Put this in
~/.codex/config.toml:
[features]
use_legacy_landlock = true
- In a Git repo, create a test file:
.codex-smoke.txt
foo
- Run:
codex exec --json -C /path/to/repo "Edit .codex-smoke.txt in the current repository by replacing the exact text 'foo' with 'bar'. Do not touch any other file."
- Observe:
- the initial shell read succeeds
- the file-change /
apply_patchstep fails with the panic above - Codex may then ask to retry without sandbox
What is the expected behavior?
One of these should happen:
apply_patchshould work whenuse_legacy_landlock = true, or- the
apply_patchpath should detect that this sandbox/helper combination is unsupported and use a compatible in-sandbox fallback without presenting a misleading sandbox-bypass prompt for normal workspace edits
Additional information
- Related older Linux sandbox issue: #17337
- Related broad regression report: #14936
- I also directly verified that the legacy landlock sandbox itself is not generally broken:
codex sandbox linux -c features.use_legacy_landlock=true --full-auto -- /bin/sh -lc 'pwd'
codex sandbox linux -c features.use_legacy_landlock=true --full-auto -- /bin/sh -lc 'touch /tmp/codex-legacy-smoke && ls -l /tmp/codex-legacy-smoke'
Both of those succeed.
6 Comments
Fix for this is to downdgrade to previous version. This is clearly a repeating bug for Codex at least for Ubuntu based systems.
npm i -g @openai/codex@0.120.0It would be really good to include automated tests for sandbox edits with the major linux distributionss prior to releases as this affects so many people.
+1 for the suggestion to add or improve test coverage for this scenario. Related to #14936.
Guys, are you really serious? How are you testing your product, the version you releasing if that issue occurs just after normal version upgrade from 0.120.0 to 0.121.0?!
In the last version the bad context window UI change, was waiting patiently for the new version so i can see the context usage again, i do an update, context window usage is back but now every edit prompts for escalation, sigh...
This is starting to feel more and more like Codex is going the Claude Code path of slop updates...
+1 every 2-3 version release im having this issue..
This is also messing me up in the desktop app. Took me a long, long time to figure out what was going on -- extremely painful.