Codex is remove the last empty line, and can not bring it back

Open 💬 3 comments Opened Mar 17, 2026 by CGQAQ

What version of Codex CLI is running?

0.115.0

What subscription do you have?

Pro

Which model were you using?

gpt-5.4

What platform is your computer?

Darwin 25.3.0 arm64 arm

What terminal emulator and version are you using (if applicable)?

iTerm2

What issue are you seeing?

Codex removes the last empty line, and can not bring it back

Removes empty line:
<img width="1072" height="490" alt="Image" src="https://github.com/user-attachments/assets/2efac361-8eaa-4ed7-b876-e0945729f5ef" />

Try to bring it back, failed:
<img width="997" height="101" alt="Image" src="https://github.com/user-attachments/assets/293f8053-f7fd-4757-9692-f4c801d52029" />

Second try:
<img width="1064" height="113" alt="Image" src="https://github.com/user-attachments/assets/b3a0fc1e-afe2-4baa-9b37-435eafc26d12" />

What steps can reproduce the bug?

Not sure, but the default patch tool (apply_patch, I guess) seems to struggle with the trailing empty line; it will struggle multiple times, then try to generate a Python script, and that will work.

What is the expected behavior?

The empty line should be added as the model says.

Additional information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗