Regression in 0.118.0: `apply_patch` enters patch-approval loop (`command failed; retry without sandbox?`) while 0.117.0 works
Summary
apply_patch appears to regress in codex-cli 0.118.0 on my machine: patch edits are previewed, then UI asks:
Reason: command failed; retry without sandbox?
If rejected, session records aborted by user after ....
The same workflow works on 0.117.0 (no escalation prompt, patch applies successfully).
Regression window
- Last known good:
codex-cli 0.117.0 - First known bad:
codex-cli 0.118.0
Environment
- OS: Ubuntu 24.04.4 LTS (Noble)
- Kernel:
Linux carbon 6.8.0-106-generic #106-Ubuntu SMP PREEMPT_DYNAMIC Fri Mar 6 07:58:08 UTC 2026 x86_64 - Shell:
/bin/bash
Repro (interactive)
- Start codex in a writable repo (workspace-write sandbox).
- Ask Codex to apply a small
apply_patchedit to an existing file. - Observe that patch preview is shown, then prompt appears:
Reason: command failed; retry without sandbox?
- Reject escalation.
- Session records
custom_tool_call_output: "aborted by user after ...".
Expected
apply_patch should apply the patch in sandbox (as it does in 0.117.0), or return a concrete underlying error (not just escalation fallback).
Actual
In 0.118.0, apply_patch repeatedly routes into patch approval/escalation flow.
Evidence from logs (0.118.0 run)
Session metadata shows 0.118.0:
~/.codex/sessions/2026/04/01/rollout-2026-04-01T09-16-29-019d47e6-a041-7600-99af-0233fda42b43.jsonlline 1 ("cli_version":"0.118.0")
apply_patch call + output:
- same file line 32:
custom_tool_call(name":"apply_patch") - line 34:
custom_tool_call_output=>"aborted by user after 33.0s" - line 63 + 65: repeated same behavior
- line 136 + 137: repeated same behavior on relative path patch
Runtime sequence around each attempt (codex-tui.log):
ToolCall: apply_patchthenop.dispatch.patch_approvaltheninterrupt received: abort current task
Example lines:
~/.codex/log/codex-tui.log:291197~/.codex/log/codex-tui.log:291211~/.codex/log/codex-tui.log:291212- repeats at
291279/291280,291439/291440
Additional note
I can confirm in my current environment that apply_patch succeeds under codex-cli 0.117.0 with the same style of patch edit.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗