Codex Triggered Full Script Deletion After Command Refusal(VS code plugin)

Resolved 💬 4 comments Opened Dec 30, 2025 by Jinjin89 Closed Feb 23, 2026
💡 Likely answer: A maintainer (etraut-openai, contributor) responded on this thread — see the highlighted reply below.

What version of Codex is running?

0.4.56 on vs code. codex-cli 0.77.0 on remote server

What subscription do you have?

Plus

Which model were you using?

_No response_

What platform is your computer?

_No response_

What issue are you seeing?

'/bin/bash -lc '"'"'file -b path/to/myscript'"'"
exec command rejected by user

<img width="856" height="494" alt="Image" src="https://github.com/user-attachments/assets/bfa14872-6a07-4e3d-a7c5-c1cb1eaac3b0" />

then the content is lost

What steps can reproduce the bug?

No idea

What is the expected behavior?

_No response_

Additional information

_No response_

View original on GitHub ↗

4 Comments

etraut-openai contributor · 8 months ago

Can you provide more details. When you say "reject the code edit", what do you mean?

Please use the /feedback slash command to upload your logs and session details and post the thread ID here.

Jinjin89 · 8 months ago

@etraut-openai

Sorry for not making this clear earlier. I have already closed the session, so I cannot provide additional information at this point.

What I mean is the following: I first asked Codex to perform a specific task. During that process, Codex attempted to run the command:

/bin/bash -lc 'file -b path/to/myscript'

From my perspective, this command was completely irrelevant to my original question, so I declined to run it. After that, all the contents of the script were lost. In the diff, the file appeared as:

plotter.R | +0 -354
meaning 0 lines added and 354 lines deleted, effectively removing the entire file.

Fortunately, there was an Undo button available, which allowed me to restore the file to its original state.

etraut-openai contributor · 8 months ago

Thanks for the explanation. Codex is working as designed in this regard, so I don't think we'd consider this a bug. I'm going to change it to an enhancement request because I think that there's room for improvement in this area. We can leave the issue open and see if other codex users upvote it.

etraut-openai contributor · 6 months ago

This feature request hasn't received enough upvotes in the past two months, so I'm going to close it.