Bug report: VSCode extension failed to revert the changes
What version of the VS Code extension are you using?
0.4.46
What subscription do you have?
bussiness
Which IDE are you using?
vscode
What platform is your computer?
Darwin 25.1.0 arm64 arm
What issue are you seeing?
Environment: macOS, VSCode extension 0.4.46.
Codex deleted parts of my code unexpectedly. When I clicked the Revert changes button in the VSCode extension, it showed “Failed to revert changes.” The history changes panel did not correctly display the deleted parts, although the conversation’s history of changes did show them. I had to manually copy and paste from the conversation history to avoid losing uncommitted code.
The revert button in the VSCode extension does not work properly and needs to be fixed. I also suggest adding an option or prompt to automatically create a commit before Codex starts editing, so it is easier to restore previous versions.
What steps can reproduce the bug?
I asked Codex to find duplicate parts in the code and delete them, but Codex mistakenly started truncating the file from an incorrect location, causing the file to be cut off and a large amount of code after that point to be lost. When I clicked the revert button (↩️), it showed “failed to revert the changes.”
What is the expected behavior?
No response
Additional information
No response
Potential duplicates detected. Please review them and close your issue if it is a duplicate.
- #6794
- #6550
- #6074
Powered by Codex Action
I would say there is a general need to have snapshots. Once we revert there is no apply patch in case we want. Also i'm not sure how the revert works if i revert non recent change. It's so confusing.
Hi @kaizhuanren, thanks for filling in this bug. How many files did you need to revert changes on? I've just tried on a dummy example and it seemed to work:
https://github.com/user-attachments/assets/108be080-515b-4a33-a656-447fc15d141b
Could you describe a bit more what you see in the IDE?
Same issue here.
Thanks for looking into this!
The key problems may be that Codex informed me that it had incorrectly truncated a document (about 3000 lines lost from a single file). After that, the VScode extension showed "Failed to revert the changes"
I am not fully aware of the internal details of how these Codex tools and vs extensions work, but my guess is that the issue I ran into is related to the tool calls failing to correctly return the corresponding results.
Same issue here.
Maybe you could also describe more details , thanks
Oh okay so did Codex by itself tried to Undo its changes @kaizhuanren ?
@aemotyka could you detail a bit more what is happening on your end?
Codex reported the error and asked if I wanted to roll back to a previous version. I agreed, but it tried to restore using the git commit history, which would have caused me to lose some uncommitted code. After that, the ↩️ undo button stopped working properly.
@lionel-oai yes, essentially after codex completed changes, I wanted to revert the most recent change, and attempted to do so by clicking the "undo" button that appears when you expand the diffs of different files shown when codex completes a task. After clicking, I get a red toast that says "failed to revert changes" (image attached here). (and the changes are not reverted). Of course I can still manually revert because I am able to see the diff, but it would be pretty valuable to be able to do this with the click of a button instead. Also, unlike @kaizhuanren, I've experienced this issue on changes spanning only a few lines, so I don't think it's a truncation issue.
(I have the same exact setup, ide, platform as the original poster here, but I am on Pro, not business. Also, I have encountered this issue with all models on codex going back to august, and it occurs whether or not my project is on git. My hunch is it has something to do with platform, because I saw a previous issue that had been closed where only specific Mac users were still reporting the issue)
I’d like to add a bit more context. In my Mac, Codex extension’s ↩️ button in VS Code doesn’t work properly in other situations either .
Codex can still revert files correctly by using apply_patch after my instruction, but the issue I first ran into was actually a more troublesome scenario.
I’d like to add a bit more context. In my Mac, Codex extension’s ↩️ button in VS Code doesn’t work properly in other situations either .
Codex can still revert files correctly by using apply_patch after my instruction, but the issue I first ran into was actually a more troublesome scenario.
Same for me in Windows vscode ide codex
same for me in vscode extension
never worked for me
yes i experienced this too.
Still having issues
Issue #2997 was closed as "resolved" with no actual fix, please leave this one open as this is clearly an ongoing issue.