File-change approval prompt is blank when reason is absent
File-Change Approval Is Blank When Reason Is Absent
Summary
In Codex CLI 0.146.0, a file-change approval can show three blank
rows between its question and choices. The prompt then asks the user
to approve an action without identifying the action or its target.
This was reproduced through local and remote terminal clients on
macOS. Execution approvals are unaffected when their justification
is present.
Cause
ApplyPatchApprovalRequest supplies reason, cwd, and changes.
The TUI header renders only a nonempty reason; it does not usecwd or the changed paths. With no reason, the header has no fields.
The existing snapshot also expects the filename and diff summary to
be absent.
Expected Result
Every file-change approval should identify the action and target:
Description: <reason or Apply proposed file edits>
Destination: <sorted absolute changed path>
The approval choices and omission of diff content should remain
unchanged.
Tested Fix
The proposed patch adds the two fields above. It uses the request
reason when available, supplies a fallback when it is absent, and
resolves each changed path against the request working directory.
Verified against official tag rust-v0.146.0:
cargo fmt --all -- --checkpassed;- the reason-present approval snapshot passed; and
- a reason-absent regression test passed.
5 Comments
I reproduced this on the current main branch and then traced it to the TUI approval header. The approval request contains the working directory and the changed paths, but when no reason is supplied, the modal renders the question and choices without any description or target files.
I have a minimal local fix that:
-> Gives a clear fallback explanation when the reason is not present;
-> Shows the impacted destination paths, fixed against the request working directory;
-> Keeps the existing approval choices and behaviors unchanged;
-> Adds regression coverage for both reason present and reason absent prompts.
-> I was able to reproduce the blank prompt before the change, which confirmed the focused tests now pass afterward, and then ran the necessary formatting, linting, and test checks.
If this approach matches the UX, I’d be happy to open a focused PR for it. Please let me know if you’d like me to continue.
A tested implementation is available for maintainer reference:
https://github.com/sivatek/codex-upstream-patches/commit/30f8859
It is based on current
openai/codexmainand changes only the TUIrenderer, its file-change approval snapshot, and test setup.
Direct current-main evidence:
cargo fmt --all -- --checkpasses.The full TUI run completed 3,350 of 3,351 tests successfully. The
unrelated focus/palette timing test failed at its 500 ms deadline and
also failed when rerun alone.
I understand external PRs are invitation-only. The branch is ready if
a maintainer decides that a pull request would be useful.
Correction to my earlier implementation note: a live test exposed that
commit
30f8859renderedDescription:but notDestination:on theembedded app-server path. That commit was incomplete.
The corrected current-main implementation is:
https://github.com/sivatek/codex-upstream-patches/commit/405f226
The root cause was loss of file changes between the buffered
ItemStartednotification and the active approval request. The newcommit recovers those changes for the active request, renders each
exact destination, and renders
Destination: unavailablefor anincomplete legacy request so the prompt does not imply informed
approval.
Direct evidence:
just fix -p codex-tuipasses with no warnings.A rebuilt 0.146.0 binary is still undergoing a real-prompt acceptance
test. I will add that result separately rather than overstate it here.
I understand external PRs are invitation-only. The branch is ready if
a maintainer decides that a pull request would be useful.
Live acceptance is now complete for the corrected implementation:
https://github.com/sivatek/codex-upstream-patches/commit/405f226
I rebuilt Codex 0.146.0 for arm64, launched the installed binary in a
fresh tmux session, and requested one file edit under read-only
sandbox policy. The native prompt displayed
Description: Apply proposed file editsand aDestination:rowcontaining the full requested path.
I denied the request with Escape and verified that the target file was
absent. This confirms the embedded active-request route, not only a
renderer unit test.
This will be fixed in 0.149.0.