Summary
On macOS ARM64 with codex-cli 0.122.0, the internal apply_patch tool can hang indefinitely under the normal sandboxed path (workspace-write / --full-auto) on a tiny local file.
The same exact patch succeeds immediately when the nested Codex run uses --dangerously-bypass-approvals-and-sandbox (danger-full-access).
This looks distinct from #17834:
#17834 is the earlier macOS 0.120.0 case where apply_patch returned a ~10s timeout with exit code 124
- this report is the newer
0.122.0 case where apply_patch is dispatched but then produces no success or error until interrupted/killed
Environment
- OS: macOS 26.3.1 (build
25D771280a)
- Arch:
arm64
- Codex CLI:
codex-cli 0.122.0
Minimal repro
mkdir -p /tmp/codex-test
printf 'one\ntwo\n' > /tmp/codex-test/test.txt
Interactive repro:
Then ask Codex:
use apply_patch to change "two" to "three" in test.txt
Non-interactive repro for the same sandboxed path:
codex exec --json --full-auto --skip-git-repo-check --cd /tmp/codex-test \
'use apply_patch to change "two" to "three" in test.txt'
Observed behavior under workspace-write
Codex reads test.txt, emits the apply_patch tool call for the expected one-line diff, and then nothing comes back from the tool path.
The patch used was:
*** Begin Patch
*** Update File: test.txt
@@
-two
+three
*** End Patch
Observed outcome:
- no success output
- no parse error
- no deterministic tool error
- file remains unchanged
- the session only ends after manual interrupt or an external timeout wrapper kills the run
In a fresh batch I ran the same --full-auto repro 5 times with an outer 45-second wrapper. Results:
0/5 succeeded
5/5 hung until killed by the wrapper
5/5 left test.txt unchanged as:
Comparison against danger-full-access
Running the same repro with:
codex exec --json --dangerously-bypass-approvals-and-sandbox --skip-git-repo-check --cd /tmp/codex-test \
'use apply_patch to change "two" to "three" in test.txt'
succeeded immediately with normal tool output:
Success. Updated the following files:
M /tmp/codex-test/test.txt
and the file became:
Why this seems important
This strongly suggests the problem is in the sandboxed filesystem / helper path used by apply_patch, not in the patch text itself. That is an inference from the behavior above, not a confirmed root cause.
Expected behavior
The same minimal patch should either:
- succeed normally under
workspace-write, or
- fail quickly with a deterministic tool error
It should not hang indefinitely on a 2-line local file.
Related
If useful, I can provide redacted session JSONL excerpts showing the workspace-write hang and the danger-full-access success.
Summary
On macOS ARM64 with
codex-cli 0.122.0, the internalapply_patchtool can hang indefinitely under the normal sandboxed path (workspace-write/--full-auto) on a tiny local file.The same exact patch succeeds immediately when the nested Codex run uses
--dangerously-bypass-approvals-and-sandbox(danger-full-access).This looks distinct from #17834:
#17834is the earlier macOS0.120.0case whereapply_patchreturned a ~10s timeout with exit code1240.122.0case whereapply_patchis dispatched but then produces no success or error until interrupted/killedEnvironment
25D771280a)arm64codex-cli 0.122.0Minimal repro
Interactive repro:
cd /tmp/codex-test codexThen ask Codex:
Non-interactive repro for the same sandboxed path:
Observed behavior under
workspace-writeCodex reads
test.txt, emits theapply_patchtool call for the expected one-line diff, and then nothing comes back from the tool path.The patch used was:
Observed outcome:
In a fresh batch I ran the same
--full-autorepro 5 times with an outer 45-second wrapper. Results:0/5succeeded5/5hung until killed by the wrapper5/5lefttest.txtunchanged as:Comparison against
danger-full-accessRunning the same repro with:
succeeded immediately with normal tool output:
and the file became:
Why this seems important
This strongly suggests the problem is in the sandboxed filesystem / helper path used by
apply_patch, not in the patch text itself. That is an inference from the behavior above, not a confirmed root cause.Expected behavior
The same minimal patch should either:
workspace-write, orIt should not hang indefinitely on a 2-line local file.
Related
If useful, I can provide redacted session JSONL excerpts showing the
workspace-writehang and thedanger-full-accesssuccess.